diff --git a/apps/api/src/services/cron.service.ts b/apps/api/src/services/cron.service.ts index 2be1c6a00..b896c684f 100644 --- a/apps/api/src/services/cron.service.ts +++ b/apps/api/src/services/cron.service.ts @@ -25,9 +25,7 @@ export class CronService { @Cron(CronExpression.EVERY_HOUR) public async runEveryHour() { - const isDataGatheringEnabled = await this.isDataGatheringEnabled(); - - if (isDataGatheringEnabled) { + if (await this.isDataGatheringEnabled()) { await this.dataGatheringService.gather7Days(); } } @@ -44,9 +42,7 @@ export class CronService { @Cron(CronService.EVERY_SUNDAY_AT_LUNCH_TIME) public async runEverySundayAtTwelvePm() { - const isDataGatheringEnabled = await this.isDataGatheringEnabled(); - - if (isDataGatheringEnabled) { + if (await this.isDataGatheringEnabled()) { const uniqueAssets = await this.dataGatheringService.getUniqueAssets(); await this.dataGatheringService.addJobsToQueue(