From 806a454b056e75a74cda0eb1ac61526b50cb468c Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Thu, 5 Dec 2013 15:25:58 -0500 Subject: [PATCH] fixing notifications.prune --- src/database/mongo.js | 9 +++++- src/database/redis.js | 14 +++++++++ src/notifications.js | 73 +++++++++++++++++++++++++------------------ src/routes/debug.js | 12 +++++++ 4 files changed, 76 insertions(+), 32 deletions(-) diff --git a/src/database/mongo.js b/src/database/mongo.js index c90f6bc3cf..a9e17b8e02 100644 --- a/src/database/mongo.js +++ b/src/database/mongo.js @@ -20,7 +20,6 @@ process.exit(); } - // TODO: fill out settings.db module.sessionStore = new mongoStore({ db: db }); @@ -477,6 +476,14 @@ }); } + module.sortedSetScore = function(key, value, callback) { + throw new Error('not-implemented'); + } + + module.sortedSetsScore = function(keys, value, callback) { + throw new Error('not-implemented'); + } + // lists module.listPrepend = function(key, value, callback) { module.isObjectField(key, 'array', function(err, exists) { diff --git a/src/database/redis.js b/src/database/redis.js index ca7f3483f2..b2a17845ce 100644 --- a/src/database/redis.js +++ b/src/database/redis.js @@ -311,6 +311,20 @@ redisClient.zrank(key, value, callback); } + module.sortedSetScore = function(key, value, callback) { + redisClient.zscore(key, value, callback); + } + + module.sortedSetsScore = function(keys, value, callback) { + var multi = redisClient.multi(); + + for(x=0; x