mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-31 11:53:32 +00:00
feat(gateway): add channel-backed readiness probes (#38285)
* Changelog: add channel-backed readiness probe entry * Gateway: add channel-backed readiness probes * Docs: describe readiness probe behavior * Gateway: add readiness probe regression tests * Changelog: dedupe gateway probe entries * Docs: fix readiness startup grace description * Changelog: remove stale readiness entry * Gateway: cover readiness hardening * Gateway: harden readiness probes
This commit is contained in:
@@ -106,6 +106,7 @@ import {
|
||||
incrementPresenceVersion,
|
||||
refreshGatewayHealthSnapshot,
|
||||
} from "./server/health-state.js";
|
||||
import { createReadinessChecker } from "./server/readiness.js";
|
||||
import { loadGatewayTlsRuntime } from "./server/tls.js";
|
||||
import {
|
||||
ensureGatewayStartupAuth,
|
||||
@@ -546,6 +547,17 @@ export async function startGatewayServer(
|
||||
if (cfgAtStart.gateway?.tls?.enabled && !gatewayTls.enabled) {
|
||||
throw new Error(gatewayTls.error ?? "gateway tls: failed to enable");
|
||||
}
|
||||
const serverStartedAt = Date.now();
|
||||
const channelManager = createChannelManager({
|
||||
loadConfig,
|
||||
channelLogs,
|
||||
channelRuntimeEnvs,
|
||||
channelRuntime: createPluginRuntime().channel,
|
||||
});
|
||||
const getReadiness = createReadinessChecker({
|
||||
channelManager,
|
||||
startedAt: serverStartedAt,
|
||||
});
|
||||
const {
|
||||
canvasHost,
|
||||
httpServer,
|
||||
@@ -589,6 +601,7 @@ export async function startGatewayServer(
|
||||
log,
|
||||
logHooks,
|
||||
logPlugins,
|
||||
getReadiness,
|
||||
});
|
||||
let bonjourStop: (() => Promise<void>) | null = null;
|
||||
const nodeRegistry = new NodeRegistry();
|
||||
@@ -618,12 +631,6 @@ export async function startGatewayServer(
|
||||
});
|
||||
let { cron, storePath: cronStorePath } = cronState;
|
||||
|
||||
const channelManager = createChannelManager({
|
||||
loadConfig,
|
||||
channelLogs,
|
||||
channelRuntimeEnvs,
|
||||
channelRuntime: createPluginRuntime().channel,
|
||||
});
|
||||
const { getRuntimeSnapshot, startChannels, startChannel, stopChannel, markChannelLoggedOut } =
|
||||
channelManager;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user