This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user