|
|
@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
|
var async = require('async'),
|
|
|
|
var async = require('async'),
|
|
|
|
winston = require('winston'),
|
|
|
|
winston = require('winston'),
|
|
|
|
cron = require('cron').CronJob,
|
|
|
|
cron = require('cron').CronJob,
|
|
|
@ -8,7 +10,6 @@ var async = require('async'),
|
|
|
|
User = require('./user');
|
|
|
|
User = require('./user');
|
|
|
|
|
|
|
|
|
|
|
|
(function(Notifications) {
|
|
|
|
(function(Notifications) {
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Notifications.init = function() {
|
|
|
|
Notifications.init = function() {
|
|
|
|
if (process.env.NODE_ENV === 'development') {
|
|
|
|
if (process.env.NODE_ENV === 'development') {
|
|
|
@ -249,10 +250,10 @@ var async = require('async'),
|
|
|
|
async.each(expiredNids, function(nid, next) {
|
|
|
|
async.each(expiredNids, function(nid, next) {
|
|
|
|
async.parallel([
|
|
|
|
async.parallel([
|
|
|
|
function(next) {
|
|
|
|
function(next) {
|
|
|
|
db.setRemove('notifications', nid, next)
|
|
|
|
db.setRemove('notifications', nid, next);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
function(next) {
|
|
|
|
function(next) {
|
|
|
|
db.delete('notifications:' + nid, next)
|
|
|
|
db.delete('notifications:' + nid, next);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
], function(err) {
|
|
|
|
], function(err) {
|
|
|
|
numPruned++;
|
|
|
|
numPruned++;
|
|
|
|