From 96e40f26a705c6912b3d3a6e6cdab33ae3778530 Mon Sep 17 00:00:00 2001 From: rob Date: Sun, 24 Jul 2022 13:18:13 -0400 Subject: [PATCH] move CRON_TIMEZONE declaration into start method --- app/workers/reeeper.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/workers/reeeper.js b/app/workers/reeeper.js index 91f1890..4e0d299 100644 --- a/app/workers/reeeper.js +++ b/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); }