MCPcopy
hub / github.com/Koenkk/zigbee2mqtt / triggerWatchdog

Function triggerWatchdog

index.js:26–40  ·  view source on GitHub ↗

@type {(code: number) => Promise }

(code)

Source from the content-addressed store, hash-verified

24
25/** @type {(code: number) => Promise<void>} */
26async function triggerWatchdog(code) {
27 const delay = watchdogDelays[watchdogCount];
28 watchdogCount += 1;
29
30 if (delay) {
31 // garbage collector
32 controller = undefined;
33
34 console.log(`WATCHDOG: Waiting ${delay / 60000}min before next start try.`);
35 await new Promise((resolve) => setTimeout(resolve, delay));
36 await start();
37 } else {
38 process.exit(code);
39 }
40}
41
42/** @type {() => Promise<void>} */
43async function restart() {

Callers 1

exitFunction · 0.85

Calls 3

exitMethod · 0.80
startFunction · 0.70
logMethod · 0.45

Tested by

no test coverage detected