From 38629554c95f431fe4045f2f5e6ebf5bc9c56ef4 Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Fri, 17 May 2024 19:04:20 +0200 Subject: [PATCH] fix: run scheduler in development if GITHUB_TOKEN set --- start/scheduler.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/start/scheduler.ts b/start/scheduler.ts index 82ab9da..be06d86 100644 --- a/start/scheduler.ts +++ b/start/scheduler.ts @@ -1,6 +1,7 @@ import { CronJob } from 'cron' import app from '@adonisjs/core/services/app' +import env from '#start/env' import { PackagesDataRefresher } from '#services/packages_data_refresher' /** @@ -11,5 +12,5 @@ CronJob.from({ start: true, cronTime: '0 */3 * * *', onTick: () => refresher.refresh(), - runOnInit: app.inProduction, + runOnInit: !!env.get('GITHUB_TOKEN') || app.inProduction, })