From dcbe4ffd4ac1d4c704691e728a2567cbf2651ead Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Thu, 5 Dec 2013 15:32:36 -0500 Subject: [PATCH] more notif.prune cleanup --- src/notifications.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/notifications.js b/src/notifications.js index 8e598bb635..9c4796858c 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -191,9 +191,6 @@ var async = require('async'), }; Notifications.prune = function(cutoff) { - // TODO: this function wont work with dbal in its current state - // things to figure out - // 2 - Need to remove the RDB.multi if (process.env.NODE_ENV === 'development') { winston.info('[notifications.prune] Removing expired notifications from the database.'); @@ -250,11 +247,10 @@ var async = require('async'), if(err) { return next(err); } + // If the notification is not present in any inbox, delete it altogether var expired = results.every(function(present) { - if (present === null) { - return true; - } + return present === null; }); if (expired) {