mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 14:35:47 +01:00
eachLimit on expire nids
This commit is contained in:
@@ -300,7 +300,7 @@ var async = require('async'),
|
|||||||
return notif.nid;
|
return notif.nid;
|
||||||
});
|
});
|
||||||
|
|
||||||
async.each(expiredNids, function(nid, next) {
|
async.eachLimit(expiredNids, 50, function(nid, next) {
|
||||||
async.parallel([
|
async.parallel([
|
||||||
function(next) {
|
function(next) {
|
||||||
db.setRemove('notifications', nid, 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.');
|
winston.info('[notifications.prune] Notification pruning completed. ' + numPruned + ' expired notification' + (numPruned !== 1 ? 's' : '') + ' removed.');
|
||||||
}
|
}
|
||||||
var diff = process.hrtime(start);
|
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');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user