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