diff --git a/backend/app/schedulers/footballApi/matches.todayAndMorrow.scheduler.ts b/backend/app/schedulers/footballApi/matches.todayAndMorrow.scheduler.ts index eee8c5b..e4d0d99 100644 --- a/backend/app/schedulers/footballApi/matches.todayAndMorrow.scheduler.ts +++ b/backend/app/schedulers/footballApi/matches.todayAndMorrow.scheduler.ts @@ -73,6 +73,9 @@ export class TodayAndMorrowScheduler extends BaseScheduler { } else if (matchStart.isBefore(moment(liveMatch.utcDate))) { liveMatch = match; } + if (liveMatch.id === this.liveMatchId) { + break; + } } else if (matchStatus === MatchStatus.SCHEDULED) { if (matchStart.isBefore(nextPoll)) { nextPoll = matchStart.add(1, 'minutes'); @@ -97,7 +100,7 @@ export class TodayAndMorrowScheduler extends BaseScheduler { const diff = nextPoll.diff(moment(), 'minutes'); nextPoll = diff <= 0 ? moment().add(1, 'minutes') : nextPoll; - if (liveMatchId != null || this.liveMatchId != null) { + if (liveMatchId != null || this.liveMatchId != null || this.liveMatchHasFinished) { nextPoll = moment().add(1, 'minutes'); } this.nextPoll = nextPoll;