From 5f7af06dc8212c5321a656ca03fc87c09ea6c6dd Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 10 Feb 2024 10:41:11 +0100 Subject: [PATCH] Clean up --- apps/api/src/services/cron.service.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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(