cr
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { Cron } from '@nestjs/schedule';
|
||||
import { FeederService } from '../modules/feeder/feeder.service';
|
||||
import { Injectable, Logger } from "@nestjs/common";
|
||||
import { Cron } from "@nestjs/schedule";
|
||||
import { FeederService } from "../modules/feeder/feeder.service";
|
||||
|
||||
@Injectable()
|
||||
export class HistoricalResultsSyncTask {
|
||||
@@ -9,7 +9,7 @@ export class HistoricalResultsSyncTask {
|
||||
constructor(private readonly feederService: FeederService) {}
|
||||
|
||||
private shouldSkipInHistoricalMode(jobName: string): boolean {
|
||||
if (process.env.FEEDER_MODE === 'historical') {
|
||||
if (process.env.FEEDER_MODE === "historical") {
|
||||
this.logger.debug(`Skipping ${jobName} in historical feeder mode`);
|
||||
return true;
|
||||
}
|
||||
@@ -19,19 +19,19 @@ export class HistoricalResultsSyncTask {
|
||||
/**
|
||||
* Pull yesterday's completed matches into the permanent matches table.
|
||||
*/
|
||||
@Cron('0 8 * * *', { timeZone: 'Europe/Istanbul' })
|
||||
@Cron("0 8 * * *", { timeZone: "Europe/Istanbul" })
|
||||
async syncPreviousDayCompletedMatches() {
|
||||
if (this.shouldSkipInHistoricalMode('syncPreviousDayCompletedMatches')) {
|
||||
if (this.shouldSkipInHistoricalMode("syncPreviousDayCompletedMatches")) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.logger.log(
|
||||
'Starting previous-day completed match sync for football and basketball...',
|
||||
"Starting previous-day completed match sync for football and basketball...",
|
||||
);
|
||||
|
||||
try {
|
||||
await this.feederService.runPreviousDayCompletedMatchesScan();
|
||||
this.logger.log('Previous-day completed match sync finished');
|
||||
this.logger.log("Previous-day completed match sync finished");
|
||||
} catch (error: any) {
|
||||
this.logger.error(
|
||||
`Previous-day completed match sync failed: ${error.message}`,
|
||||
|
||||
Reference in New Issue
Block a user