mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
interim commit
This commit is contained in:
@@ -24,9 +24,6 @@
|
||||
"forum": '../forum'
|
||||
}
|
||||
});
|
||||
requirejs.onError = function(err) {
|
||||
console.log(err);
|
||||
}
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="{relative_path}/css/theme.css" />
|
||||
|
||||
@@ -30,6 +30,7 @@ var RDB = require('./redis.js'),
|
||||
* the new one put in its place.
|
||||
*/
|
||||
RDB.incr('notifications:next_nid', function(err, nid) {
|
||||
RDB.sadd('notifications', nid);
|
||||
RDB.hmset('notifications:' + nid, {
|
||||
text: text || '',
|
||||
path: path || null,
|
||||
@@ -124,6 +125,14 @@ var RDB = require('./redis.js'),
|
||||
});
|
||||
} else callback();
|
||||
});
|
||||
},
|
||||
prune: function(cutoff, callback) {
|
||||
var today = new Date();
|
||||
if (!cutoff || !(cutoff instanceof Date)) cutoff = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 7);
|
||||
|
||||
RDB.smembers('notifications', function(err, nids) {
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,27 @@ Upgrade.upgrade = function() {
|
||||
next();
|
||||
}
|
||||
});
|
||||
},
|
||||
function(next) {
|
||||
RDB.exists('notifications', function(err, exists) {
|
||||
if (!exists) {
|
||||
RDB.keys('notifications:*', function(err, keys) {
|
||||
var multi = RDB.multi();
|
||||
|
||||
keys = keys.filter(function(key) {
|
||||
if (key === 'notifications:next_nid') return false;
|
||||
else return true;
|
||||
}).map(function(key) {
|
||||
return key.slice(14);
|
||||
});
|
||||
|
||||
winston.info('[2013/10/23] Adding existing notifications to set');
|
||||
RDB.sadd('notifications', keys, next);
|
||||
});
|
||||
} else {
|
||||
winston.info('[2013/10/23] Updates to Notifications skipped.');
|
||||
}
|
||||
});
|
||||
}
|
||||
// Add new schema updates here
|
||||
], function(err) {
|
||||
|
||||
Reference in New Issue
Block a user