From ea2975cb3f267a37f7f8b913840dab703ccd18af Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 8 Aug 2014 16:28:29 -0400 Subject: [PATCH] eachLimit on expire nids --- src/notifications.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/notifications.js b/src/notifications.js index bb473d4235..b5d61895e5 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -300,7 +300,7 @@ var async = require('async'), return notif.nid; }); - async.each(expiredNids, function(nid, next) { + async.eachLimit(expiredNids, 50, function(nid, next) { async.parallel([ function(next) { db.setRemove('notifications', nid, next); @@ -321,7 +321,7 @@ var async = require('async'), winston.info('[notifications.prune] Notification pruning completed. ' + numPruned + ' expired notification' + (numPruned !== 1 ? 's' : '') + ' removed.'); } var diff = process.hrtime(start); - events.log('Pruning '+ numPruned + 'notifications took : ' + (diff[0] * 1e3 + diff[1] / 1e6) + ' ms'); + events.log('Pruning '+ numPruned + ' notifications took : ' + (diff[0] * 1e3 + diff[1] / 1e6) + ' ms'); }); }); });