added timing to prune

This commit is contained in:
Baris Soner Usakli
2014-02-11 15:13:02 -05:00
parent 11b0f44ae9
commit daa1154797
2 changed files with 7 additions and 2 deletions

View File

@@ -197,6 +197,8 @@ var async = require('async'),
};
Notifications.prune = function(cutoff) {
var start = process.hrtime();
if (process.env.NODE_ENV === 'development') {
winston.info('[notifications.prune] Removing expired notifications from the database.');
}
@@ -269,6 +271,9 @@ var async = require('async'),
if (process.env.NODE_ENV === 'development') {
winston.info('[notifications.prune] Notification pruning completed. ' + numPruned + ' expired notification' + (numPruned !== 1 ? 's' : '') + ' removed.');
}
var diff = process.hrtime(start);
events.log('Pruning notifications took : ' + (diff[0] * 1e3 + diff[1] / 1e6) + ' ms');
});
});