From 76aa55c68f4ca8196c6c60c86c68b160b908041c Mon Sep 17 00:00:00 2001 From: Thomas <4159106+dtslvr@users.noreply.github.com> Date: Tue, 27 Dec 2022 09:35:08 +0100 Subject: [PATCH] Change execution time --- apps/api/src/services/cron.service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/api/src/services/cron.service.ts b/apps/api/src/services/cron.service.ts index 727ff0998..e3141ebe7 100644 --- a/apps/api/src/services/cron.service.ts +++ b/apps/api/src/services/cron.service.ts @@ -11,6 +11,8 @@ import { TwitterBotService } from './twitter-bot/twitter-bot.service'; @Injectable() export class CronService { + private static readonly EVERY_SUNDAY_AT_LUNCH_TIME = '0 12 * * 0'; + public constructor( private readonly dataGatheringService: DataGatheringService, private readonly exchangeRateDataService: ExchangeRateDataService, @@ -28,12 +30,12 @@ export class CronService { } @Cron(CronExpression.EVERY_DAY_AT_5PM) - public async runEveryDayAtFivePM() { + public async runEveryDayAtFivePm() { this.twitterBotService.tweetFearAndGreedIndex(); } - @Cron(CronExpression.EVERY_WEEKEND) - public async runEveryWeekend() { + @Cron(CronService.EVERY_SUNDAY_AT_LUNCH_TIME) + public async runEverySundayAtTwelvePm() { const uniqueAssets = await this.dataGatheringService.getUniqueAssets(); for (const { dataSource, symbol } of uniqueAssets) {