mirror of
https://github.com/thinkjs/thinkjs.git
synced 2026-01-25 14:42:47 +00:00
Cache和Session的rm方法都返回Promise
This commit is contained in:
parent
2e079eb35a
commit
5bd488d116
@ -106,8 +106,13 @@ module.exports = Cache(function(){
|
||||
rm: function(name){
|
||||
var filePath = this.getStoredFile(name);
|
||||
if (isFile(filePath)) {
|
||||
fs.unlink(filePath, function(){});
|
||||
var deferred = getDefer();
|
||||
fs.unlink(filePath, function(){
|
||||
deferred.resolve();
|
||||
})
|
||||
return deferred.promise;
|
||||
}
|
||||
return getPromise();
|
||||
},
|
||||
/**
|
||||
* gc
|
||||
|
||||
@ -88,6 +88,7 @@ module.exports = Cache(function(){
|
||||
if (this.data) {
|
||||
delete this.data[name];
|
||||
}
|
||||
return getPromise();
|
||||
},
|
||||
/**
|
||||
* 将数据保存到数据库中
|
||||
|
||||
@ -118,6 +118,7 @@ module.exports = Class(function(){
|
||||
if (key in this.cacheData) {
|
||||
delete this.cacheData[key].data[name];
|
||||
}
|
||||
return getPromise();
|
||||
},
|
||||
/**
|
||||
* gc
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "thinkjs",
|
||||
"description": "A MVC Web Framework For Node.js",
|
||||
"version": "0.5.28",
|
||||
"version": "0.5.29",
|
||||
"author": {
|
||||
"name": "welefen",
|
||||
"email": "welefen@gmail.com"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user