some work on session login etc

This commit is contained in:
Julian Lam
2013-04-24 16:42:12 -04:00
parent dfd5c9960b
commit c1186f396e
7 changed files with 74 additions and 33 deletions

View File

@@ -22,8 +22,9 @@
}
}
RedisDB.set = function(key, value) {
RedisDB.set = function(key, value, expiry) {
db.set(key, value);
if (expiry !== undefined) RedisDB.expire(key, expiry);
};
RedisDB.get = function(key, callback, error_handler) {
@@ -36,6 +37,10 @@
db.del(key);
}
RedisDB.expire = function(key, expiry) {
db.expire(key, expiry);
}
// Atomic Operations
RedisDB.incr = function(key, callback, error_handler) {
db.incr(key, function(error, data) {