1
0
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:
John Crepezzi
2011-11-28 01:13:14 -05:00
parent cd9bf18d29
commit 92e0f579ca
5 changed files with 12 additions and 8 deletions

View File

@@ -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);
});
};