mirror of
https://github.com/seejohnrun/haste-server.git
synced 2025-12-20 23:31:29 +00:00
Kick expirations back on view
This commit is contained in:
@@ -53,7 +53,7 @@ RedisDocumentStore.prototype.set = function(key, data, callback, skipExpire) {
|
||||
RedisDocumentStore.prototype.setExpiration = function(key) {
|
||||
if (this.expire) {
|
||||
RedisDocumentStore.client.expire(key, this.expire, function(err, reply) {
|
||||
if (err || !reply) {
|
||||
if (err) {
|
||||
winston.error('failed to set expiry on key: ' + key);
|
||||
}
|
||||
});
|
||||
@@ -61,8 +61,12 @@ RedisDocumentStore.prototype.setExpiration = function(key) {
|
||||
};
|
||||
|
||||
// Get a file from a key
|
||||
RedisDocumentStore.prototype.get = function(key, callback) {
|
||||
RedisDocumentStore.prototype.get = function(key, callback, skipExpire) {
|
||||
var _this = this;
|
||||
RedisDocumentStore.client.get(key, function(err, reply) {
|
||||
if (!err && !skipExpire) {
|
||||
_this.setExpiration(key);
|
||||
}
|
||||
callback(err ? false : reply);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user