diff --git a/src/database/redis.js b/src/database/redis.js index 9bc329d85f..76fa920c84 100644 --- a/src/database/redis.js +++ b/src/database/redis.js @@ -8,6 +8,7 @@ nconf = require('nconf'), express = require('express'), connectRedis = require('connect-redis')(express), + reds = require('reds'), redis_socket_or_host = nconf.get('redis:host'), utils = require('./../../public/src/utils.js'); @@ -28,6 +29,10 @@ ttl: 60 * 60 * 24 * 30 }); + reds.createClient = function () { + return reds.client || (reds.client = redisClient); + }; + if (nconf.get('redis:password')) { redisClient.auth(nconf.get('redis:password')); } diff --git a/src/notifications.js b/src/notifications.js index 9c4796858c..030478701b 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -243,7 +243,7 @@ var async = require('async'), async.eachSeries(results.expiredNids, function(nid, next) { - db.sortedSetsScore(results.inboxes, function(err, results) { + db.sortedSetsScore(results.inboxes, nid, function(err, results) { if(err) { return next(err); }