MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / scheduleNextMidnightCheck

Function scheduleNextMidnightCheck

src/bootstrap/dateChangeDetection.ts:45–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43 };
44
45 const scheduleNextMidnightCheck = (): number => {
46 const msUntilMidnight = getMillisecondsUntilNextLocalMidnight(getNow());
47
48 if (midnightTimeout !== null) {
49 timer.clearTimeout(midnightTimeout);
50 }
51
52 midnightTimeout = timer.setTimeout(() => {
53 checkDateChange();
54 scheduleNextMidnightCheck();
55 }, msUntilMidnight);
56
57 registerTimer(midnightTimeout);
58 return midnightTimeout;
59 };
60
61 const intervalId = timer.setInterval(checkDateChange, intervalMs);
62 registerTimer(intervalId);

Callers 1

startDateChangeDetectionFunction · 0.85

Calls 4

checkDateChangeFunction · 0.70
clearTimeoutMethod · 0.65
setTimeoutMethod · 0.65

Tested by

no test coverage detected