Update feeder.service.ts
Deploy Iddaai Backend / build-and-deploy (push) Successful in 30s

This commit is contained in:
2026-04-25 02:23:38 +03:00
parent 9027cc9900
commit eab95c4e5c
+13 -2
View File
@@ -310,9 +310,20 @@ export class FeederService {
const { startTs: targetDateStartTs, endTs: targetDateEndTs } = const { startTs: targetDateStartTs, endTs: targetDateEndTs } =
this.getDayBoundsForTimeZone(dateString, this.DAILY_SYNC_TIME_ZONE); this.getDayBoundsForTimeZone(dateString, this.DAILY_SYNC_TIME_ZONE);
// DEBUG: Log sample mstUtc values vs target bounds to diagnose filtering
if (allMatches.length > 0) {
const sample = allMatches.slice(0, 3);
this.logger.warn(
`[${sport}] [${dateString}] DEBUG: bounds=[${targetDateStartTs}, ${targetDateEndTs}] ` +
`(${new Date(targetDateStartTs * 1000).toISOString()} - ${new Date(targetDateEndTs * 1000).toISOString()}) | ` +
`sampleMstUtc=[${sample.map((m) => `${m.mstUtc} (asSec=${new Date(m.mstUtc * 1000).toISOString()}, asMs=${new Date(m.mstUtc).toISOString()})`).join(', ')}]`,
);
}
const dateFilteredMatches = allMatches.filter((m) => { const dateFilteredMatches = allMatches.filter((m) => {
const matchTs = m.mstUtc; // mstUtc is in milliseconds from API, bounds are in seconds
return matchTs >= targetDateStartTs && matchTs <= targetDateEndTs; const matchTsSec = Math.floor(m.mstUtc / 1000);
return matchTsSec >= targetDateStartTs && matchTsSec <= targetDateEndTs;
}); });
const apiReturnedCount = allMatches.length; const apiReturnedCount = allMatches.length;