fix(gateway): hot-reload channelHealthCheckMinutes without full restart

The health monitor was created once at startup and never touched by
applyHotReload(), so changing channelHealthCheckMinutes only took
effect after a full gateway restart.

Wire up a "restart-health-monitor" reload action so hot-reload can
stop the old monitor and (re)create one with the updated interval —
or disable it entirely when set to 0.

Closes #32105

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
scoootscooob
2026-03-02 12:47:55 -08:00
committed by Peter Steinberger
parent b782ecb7eb
commit 0f1388fa15
4 changed files with 33 additions and 1 deletions

View File

@@ -656,7 +656,7 @@ export async function startGatewayServer(
const healthCheckMinutes = cfgAtStart.gateway?.channelHealthCheckMinutes;
const healthCheckDisabled = healthCheckMinutes === 0;
const channelHealthMonitor = healthCheckDisabled
let channelHealthMonitor = healthCheckDisabled
? null
: startChannelHealthMonitor({
channelManager,
@@ -841,6 +841,7 @@ export async function startGatewayServer(
heartbeatRunner,
cronState,
browserControl,
channelHealthMonitor,
}),
setState: (nextState) => {
hooksConfig = nextState.hooksConfig;
@@ -849,6 +850,7 @@ export async function startGatewayServer(
cron = cronState.cron;
cronStorePath = cronState.storePath;
browserControl = nextState.browserControl;
channelHealthMonitor = nextState.channelHealthMonitor;
},
startChannel,
stopChannel,
@@ -857,6 +859,8 @@ export async function startGatewayServer(
logChannels,
logCron,
logReload,
createHealthMonitor: (checkIntervalMs: number) =>
startChannelHealthMonitor({ channelManager, checkIntervalMs }),
});
return startGatewayConfigReloader({