chore: log when worldState time is behind real time
All checks were successful
Build / build (pull_request) Successful in 1m22s

This commit is contained in:
Sainan 2025-07-29 11:56:16 +02:00
parent b21bca7a6d
commit 2054a56620

View File

@ -1336,6 +1336,12 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
}
}
const timeSecs = getIdealTimeSatsifyingConstraints(constraints);
if (constraints.length != 0) {
const delta = Math.trunc(Date.now() / 1000) - timeSecs;
if (delta != 0) {
logger.debug(`reported time is ${delta} seconds behind real time to satisfy selected constraints`);
}
}
const timeMs = timeSecs * 1000;
const day = Math.trunc((timeMs - EPOCH) / 86400000);
const week = Math.trunc(day / 7);