mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-15 18:52:24 +00:00
poormanscron: run once ever hour on client
This commit is contained in:
parent
a3fae756ef
commit
e4257766a6
3 changed files with 9 additions and 2 deletions
|
|
@ -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'));
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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": "*",
|
||||
|
|
|
|||
|
|
@ -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'))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue