Skip to content

Commit

Permalink
fix: run scheduler in development if GITHUB_TOKEN set
Browse files Browse the repository at this point in the history
  • Loading branch information
ThisIsMissEm authored and Julien-R44 committed May 18, 2024
1 parent c85ebc6 commit 3862955
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion start/scheduler.ts
Original file line number Diff line number Diff line change
@@ -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'

/**
Expand All @@ -11,5 +12,5 @@ CronJob.from({
start: true,
cronTime: '0 */3 * * *',
onTick: () => refresher.refresh(),
runOnInit: app.inProduction,
runOnInit: !!env.get('GITHUB_TOKEN') || app.inProduction,
})

0 comments on commit 3862955

Please sign in to comment.