Browse Source

move CRON_TIMEZONE declaration into start method

develop^2
Rob Colbert 2 years ago
parent
commit
96e40f26a7
  1. 4
      app/workers/reeeper.js

4
app/workers/reeeper.js

@ -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