mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-22 15:39:11 +00:00
fix clock drift (#1531)
This commit is contained in:
committed by
GitHub
parent
069a003787
commit
eab916f410
@@ -39,5 +39,6 @@ export function getShouldTimerUpdate(previousValue: MaybeNumber, currentValue: M
|
|||||||
export function getForceUpdate(previousUpdate: number, now: number): boolean {
|
export function getForceUpdate(previousUpdate: number, now: number): boolean {
|
||||||
const isClockBehind = now < previousUpdate;
|
const isClockBehind = now < previousUpdate;
|
||||||
const hasExceededRate = now - previousUpdate >= timerConfig.notificationRate;
|
const hasExceededRate = now - previousUpdate >= timerConfig.notificationRate;
|
||||||
return isClockBehind || hasExceededRate;
|
const newSeconds = millisToSeconds(previousUpdate) !== millisToSeconds(now);
|
||||||
|
return isClockBehind || hasExceededRate || newSeconds;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user