From 22204839150d1a26a09913e688e5c6c08afb2b6a Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 12 Mar 2014 15:59:02 -0400 Subject: [PATCH] notifications --- src/notifications.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/notifications.js b/src/notifications.js index 66eed78704..90e4dd9678 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -1,3 +1,5 @@ +'use strict'; + var async = require('async'), winston = require('winston'), cron = require('cron').CronJob, @@ -8,7 +10,6 @@ var async = require('async'), User = require('./user'); (function(Notifications) { - "use strict"; Notifications.init = function() { if (process.env.NODE_ENV === 'development') { @@ -63,11 +64,11 @@ var async = require('async'), Notifications.create = function(data, callback) { /** - * data.uniqueId is used solely to override stale nids. - * If a new nid is pushed to a user and an existing nid in the user's - * (un)read list contains the same uniqueId, it will be removed, and - * the new one put in its place. - */ + *data.uniqueId is used solely to override stale nids. + * If a new nid is pushed to a user and an existing nid in the user's + * (un)read list contains the same uniqueId, it will be removed, and + * the new one put in its place. + */ // Add default values to data Object if not already set var defaults = { @@ -249,10 +250,10 @@ var async = require('async'), async.each(expiredNids, function(nid, next) { async.parallel([ function(next) { - db.setRemove('notifications', nid, next) + db.setRemove('notifications', nid, next); }, function(next) { - db.delete('notifications:' + nid, next) + db.delete('notifications:' + nid, next); } ], function(err) { numPruned++;