Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
8b70d15c
Commit
8b70d15c
authored
Oct 13, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
a7591a18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
im-center/app/base/utils/redisClient.js
+9
-2
No files found.
im-center/app/base/utils/redisClient.js
View file @
8b70d15c
...
...
@@ -3,6 +3,7 @@ const redis = require("redis");
const
settings
=
require
(
"../../config/settings"
);
const
bluebird
=
require
(
"bluebird"
);
bluebird
.
promisifyAll
(
redis
);
require
(
"redis-scanrx"
)(
redis
)
// const logCtl=system.getObject("web.oplogCtl");
class
RedisClient
{
constructor
()
{
...
...
@@ -193,6 +194,10 @@ class RedisClient {
async
smembers
(
key
)
{
return
this
.
client
.
smembersAsync
(
key
);
}
async
sscan
(
key
,
pattern
)
{
let
x
=
await
this
.
client
.
sscanrx
(
key
,
pattern
).
toArray
().
toPromise
()
return
x
}
async
exists
(
key
)
{
return
this
.
client
.
existsAsync
(
key
);
}
...
...
@@ -212,8 +217,10 @@ module.exports = RedisClient;
// await client.sadd("h", ["jy"])
// await client.sadd("h", ["ak"])
// let ms = await client.smembers("h")
// console.log(ms)
// // let s = await client.smembers("h")
// // console.log(s)
// let a = await client.sscan("h", "j*")
// console.log(a)
// })()
// client.keys('*').then(s=>{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment