move CRON_TIMEZONE declaration into start method

master
rob 2 years ago
parent 92b30b3bc8
commit 96e40f26a7

@ -17,8 +17,6 @@ const {
const { CronJob } = require('cron');
const CRON_TIMEZONE = 'America/New_York';
module.rootPath = path.resolve(__dirname, '..', '..');
module.pkg = require(path.resolve(__dirname, '..', '..', 'package.json'));
@ -38,7 +36,9 @@ class ReeeperWorker extends SiteWorker {
}
async start ( ) {
const CRON_TIMEZONE = 'America/New_York';
await super.start();
await this.expireCrashedHosts(); // first-run the expirations
this.expireJob = new CronJob('*/5 * * * * *', this.expireCrashedHosts.bind(this), null, true, CRON_TIMEZONE);
}

Loading…
Cancel
Save