Commit 8b70d15c by 蒋勇

d

parent a7591a18
......@@ -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=>{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment