diff --git a/apps/server/src/services/runtime-service/RuntimeService.ts b/apps/server/src/services/runtime-service/RuntimeService.ts index cb6d09191..5ebdb3d1d 100644 --- a/apps/server/src/services/runtime-service/RuntimeService.ts +++ b/apps/server/src/services/runtime-service/RuntimeService.ts @@ -716,6 +716,9 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert // combine all big changes const hasImmediateChanges = hasNewLoaded || justStarted || hasChangedPlayback || offsetModeChanged; + // we would like the wall clock to tick on a regular rate + const beutyClockUpdate = getShouldClockUpdate(RuntimeService.previousClockUpdate, state.clock); + /** * Timer should be updated if * - big changes @@ -732,6 +735,7 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert /** * Runtime should be updated if + * - clock tick * - big changes * - the timer is updating so runtime also updates to keep them in sync ??? * - notification rate has been exceeded @@ -739,7 +743,10 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert * Then check if there is actually a change in the data */ const shouldRuntimeUpdate = - (hasImmediateChanges || shouldUpdateTimer || getForceUpdate(RuntimeService.previousRuntimeUpdate, state.clock)) && + (beutyClockUpdate || + hasImmediateChanges || + shouldUpdateTimer || + getForceUpdate(RuntimeService.previousRuntimeUpdate, state.clock)) && !deepEqual(RuntimeService.previousState?.runtime, state.runtime); /** @@ -750,13 +757,9 @@ function broadcastResult(_target: any, _propertyKey: string, descriptor: Propert /** * Many other values are calculated based on the clock * so if any of them are updated we also need to send the clock - * in case nothing else is updating the clock will bw updated at the notification rate + * in case nothing else is updating the clock will be updated at the notification rate */ - const shouldUpdateClock = - shouldUpdateTimer || - shouldRuntimeUpdate || - shouldBlockUpdate || - getForceUpdate(RuntimeService.previousClockUpdate, state.clock); + const shouldUpdateClock = shouldRuntimeUpdate || shouldBlockUpdate || beutyClockUpdate; //Now we set all the updates on the eventstore and update the previous value if (hasChangedPlayback) { diff --git a/apps/server/src/services/runtime-service/rundownService.utils.ts b/apps/server/src/services/runtime-service/rundownService.utils.ts index 4d8e7e68e..99c5fbe9e 100644 --- a/apps/server/src/services/runtime-service/rundownService.utils.ts +++ b/apps/server/src/services/runtime-service/rundownService.utils.ts @@ -9,10 +9,6 @@ import { timerConfig } from '../../setup/config.js'; * - we have rolled into a new seconds unit */ export function getShouldClockUpdate(previousUpdate: number, now: number): boolean { - const shouldForceUpdate = getForceUpdate(previousUpdate, now); - if (shouldForceUpdate) { - return true; - } const newSeconds = millisToSeconds(now, TimerType.CountUp) !== millisToSeconds(previousUpdate, TimerType.CountUp); return newSeconds; }