From 8c5aaa090127c51e6d6d73eef695129458f67d72 Mon Sep 17 00:00:00 2001 From: Carlos Valente <34649812+cpvalente@users.noreply.github.com> Date: Fri, 22 Mar 2024 08:04:23 +0100 Subject: [PATCH] fix: account for midnight rollover (#846) --- apps/server/src/services/TimerService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/server/src/services/TimerService.ts b/apps/server/src/services/TimerService.ts index 0b108eac0..1984cb07a 100644 --- a/apps/server/src/services/TimerService.ts +++ b/apps/server/src/services/TimerService.ts @@ -139,7 +139,9 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert // to apply custom logic for different datasets // some of the data, we only update at intervals - const isTimeToUpdate = state.clock - TimerService.previousUpdate >= TimerService._updateInterval; + const isTimeToUpdate = + state.clock < TimerService.previousUpdate || + state.clock - TimerService.previousUpdate >= TimerService._updateInterval; // some changes need an immediate update const hasNewLoaded = state.eventNow?.id !== TimerService.previousState?.eventNow?.id;