mirror of
https://github.com/thinkjs/thinkjs.git
synced 2026-01-25 14:42:47 +00:00
修复redis设置超时无效的问题
This commit is contained in:
parent
ce2f910c49
commit
ae96c4e7b5
@ -70,8 +70,15 @@ module.exports = Class(function(){
|
||||
get: function(name){
|
||||
return this.wrap('get', [name]);
|
||||
},
|
||||
set: function(name, value){
|
||||
return this.wrap('set', [name, value]);
|
||||
set: function(name, value, timeout){
|
||||
var setP = [this.wrap('set', [name, value])];
|
||||
if (timeout !== undefined) {
|
||||
setP.push(this.expire(name, timeout));
|
||||
}
|
||||
return Promise.all(setP);
|
||||
},
|
||||
expire: function(name, timeout){
|
||||
return this.wrap('expire', [name, timeout]);
|
||||
}
|
||||
}
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user