refactor recovering from cron

This commit is contained in:
Matteo Pagliazzi
2016-05-25 19:58:18 +02:00
parent 31850830a0
commit ed815d4947
3 changed files with 83 additions and 57 deletions

View File

@@ -83,8 +83,6 @@ function performSleepTasks (user, tasksByType, now) {
export function cron (options = {}) {
let {user, tasksByType, analytics, now = new Date(), daysMissed, timezoneOffsetFromUserPrefs} = options;
user.auth.timestamps.loggedin = now;
user.lastCron = now;
user.preferences.timezoneOffsetAtLastCron = timezoneOffsetFromUserPrefs;
// User is only allowed a certain number of drops a day. This resets the count.
if (user.items.lastDrop.count > 0) user.items.lastDrop.count = 0;