mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 15:40:21 +00:00
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:
committed by
Peter Steinberger
parent
b782ecb7eb
commit
0f1388fa15
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user