Change certain values to const

This commit is contained in:
Dennis Jung 2017-02-01 14:05:01 +09:00
parent 461d88f6f2
commit 350e05ab06
4 changed files with 19 additions and 14 deletions

View file

@ -45,20 +45,21 @@ module.exports = callback => {
return callback(err);
}
let checkLoop = () => {
const timezone_timeout = 60 * 60 * 1000;
let curUtcDate = new Date().toISOString().split('T').shift();
if (curUtcDate !== lastCheck) {
updateTimezoneOffsets(err => {
if (err) {
log.error('UTC', err);
}
setTimeout(checkLoop, 60 * 60 * 1000);
setTimeout(checkLoop, timezone_timeout);
});
} else {
setTimeout(checkLoop, 60 * 60 * 1000);
setTimeout(checkLoop, timezone_timeout);
}
lastCheck = curUtcDate;
};
setTimeout(checkLoop, 60 * 60 * 1000);
setTimeout(checkLoop, timezone_timeout);
callback(null, true);
});
};