first (part 3: src directory)
Deploy Iddaai Backend / build-and-deploy (push) Successful in 33s

This commit is contained in:
2026-04-16 15:12:27 +03:00
parent 2f0b85a0c7
commit 182f4aae16
125 changed files with 22552 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
import { Injectable, Logger } from '@nestjs/common';
import { Cron } from '@nestjs/schedule';
import { FeederService } from '../modules/feeder/feeder.service';
@Injectable()
export class HistoricalResultsSyncTask {
private readonly logger = new Logger(HistoricalResultsSyncTask.name);
constructor(private readonly feederService: FeederService) {}
private shouldSkipInHistoricalMode(jobName: string): boolean {
if (process.env.FEEDER_MODE === 'historical') {
this.logger.debug(`Skipping ${jobName} in historical feeder mode`);
return true;
}
return false;
}
/**
* Pull yesterday's completed matches into the permanent matches table.
*/
@Cron('0 8 * * *', { timeZone: 'Europe/Istanbul' })
async syncPreviousDayCompletedMatches() {
if (this.shouldSkipInHistoricalMode('syncPreviousDayCompletedMatches')) {
return;
}
this.logger.log(
'Starting previous-day completed match sync for football and basketball...',
);
try {
await this.feederService.runPreviousDayCompletedMatchesScan();
this.logger.log('Previous-day completed match sync finished');
} catch (error: any) {
this.logger.error(
`Previous-day completed match sync failed: ${error.message}`,
);
}
}
}