Run signed health as a sequential daemon loop

This commit is contained in:
Meta Vens 2026-08-20 20:15:41 +02:00
commit 2a905354b9

View file

@ -22,11 +22,7 @@ try {
console.error("Heimdall verse publication failed on interval:", error);
});
}, versePulseIntervalMs);
const healthTimer = setInterval(() => {
void publishHealthState().catch((error) => {
console.error("Heimdall signed health publication failed on interval:", error);
});
}, healthPulseIntervalMs);
void runHealthPulseLoop();
verseTimer.unref?.();
} catch (error) {
app.log.error(error);
@ -47,3 +43,12 @@ async function publishHealthState(): Promise<void> {
observedAt: pulse.updatedAt,
});
}
async function runHealthPulseLoop(): Promise<void> {
for (;;) {
await new Promise((resolve) => setTimeout(resolve, healthPulseIntervalMs));
await publishHealthState().catch((error) => {
console.error("Heimdall signed health publication failed on interval:", error);
});
}
}