Handle status fanout rejections (Refs #66)
This commit is contained in:
@@ -12,6 +12,9 @@ let booted = false;
|
||||
function boot(): void {
|
||||
if (booted) return;
|
||||
booted = true;
|
||||
process.on('unhandledRejection', reason => {
|
||||
console.error('[process] unhandled rejection:', reason);
|
||||
});
|
||||
migrate();
|
||||
interruptDeployments();
|
||||
startWorker();
|
||||
|
||||
@@ -276,9 +276,11 @@ export function startWorker(): void {
|
||||
|
||||
void tick();
|
||||
reconcileRequesters();
|
||||
void fanoutStatus();
|
||||
void fanoutStatus().catch(err => { console.error('[worker] status fanout error:', err); });
|
||||
tickTimer = setInterval(() => { void tick(); reconcileRequesters(); }, TICK_MS);
|
||||
statusTimer = setInterval(fanoutStatus, STATUS_REFRESH_MS);
|
||||
statusTimer = setInterval(() => {
|
||||
void fanoutStatus().catch(err => { console.error('[worker] status fanout error:', err); });
|
||||
}, STATUS_REFRESH_MS);
|
||||
|
||||
console.log('[worker] started — sweep every', TICK_MS, 'ms, status every', STATUS_REFRESH_MS, 'ms');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user