fix(heartbeat): remove unhandled rejection crash in wake handler
The async setTimeout callback re-threw errors without a .catch() handler, causing unhandled promise rejections that crashed the gateway. The error is already logged by the heartbeat runner and a retry is scheduled, so the re-throw served no purpose. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -37,10 +37,10 @@ function schedule(coalesceMs: number) {
|
|||||||
pendingReason = reason ?? "retry";
|
pendingReason = reason ?? "retry";
|
||||||
schedule(DEFAULT_RETRY_MS);
|
schedule(DEFAULT_RETRY_MS);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch {
|
||||||
|
// Error is already logged by the heartbeat runner; schedule a retry.
|
||||||
pendingReason = reason ?? "retry";
|
pendingReason = reason ?? "retry";
|
||||||
schedule(DEFAULT_RETRY_MS);
|
schedule(DEFAULT_RETRY_MS);
|
||||||
throw err;
|
|
||||||
} finally {
|
} finally {
|
||||||
running = false;
|
running = false;
|
||||||
if (pendingReason || scheduled) schedule(coalesceMs);
|
if (pendingReason || scheduled) schedule(coalesceMs);
|
||||||
|
|||||||
Reference in New Issue
Block a user