poormanscron: run once ever hour on client

This commit is contained in:
Tyler Renelle 2012-07-11 10:17:47 -04:00
parent a3fae756ef
commit e4257766a6
3 changed files with 9 additions and 2 deletions

View file

@ -525,6 +525,9 @@ ready(function(model) {
return model.set('_user.lastCron', lastCron);
};
poormanscron();
setInterval((function() {
return poormanscron();
}), 3600000);
exports.toggleDebug = function() {
return model.set('_debug', !model.get('_debug'));
};

View file

@ -1,7 +1,7 @@
{
"name": "habitrpg",
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
"version": "0.0.0-35",
"version": "0.0.0-37",
"main": "./server.js",
"dependencies": {
"derby": "*",

View file

@ -395,7 +395,11 @@ ready (model) ->
endOfDayTally()
lastCron = new Date()
model.set('_user.lastCron', lastCron)
poormanscron()
poormanscron() # Run once on refresh
setInterval (-> # Then run once every hour
poormanscron()
), 3600000
exports.toggleDebug = ->
model.set('_debug', !model.get('_debug'))