mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-30 01:05:02 +00:00
refactor(gateway): cache hook proxy config in runtime state
This commit is contained in:
@@ -107,6 +107,7 @@ import {
|
||||
incrementPresenceVersion,
|
||||
refreshGatewayHealthSnapshot,
|
||||
} from "./server/health-state.js";
|
||||
import { resolveHookClientIpConfig } from "./server/hooks.js";
|
||||
import { createReadinessChecker } from "./server/readiness.js";
|
||||
import { loadGatewayTlsRuntime } from "./server/tls.js";
|
||||
import {
|
||||
@@ -511,6 +512,7 @@ export async function startGatewayServer(
|
||||
tailscaleMode,
|
||||
} = runtimeConfig;
|
||||
let hooksConfig = runtimeConfig.hooksConfig;
|
||||
let hookClientIpConfig = resolveHookClientIpConfig(cfgAtStart);
|
||||
const canvasHostEnabled = runtimeConfig.canvasHostEnabled;
|
||||
|
||||
// Create auth rate limiters used by connect/auth flows.
|
||||
@@ -613,6 +615,7 @@ export async function startGatewayServer(
|
||||
rateLimiter: authRateLimiter,
|
||||
gatewayTls,
|
||||
hooksConfig: () => hooksConfig,
|
||||
getHookClientIpConfig: () => hookClientIpConfig,
|
||||
pluginRegistry,
|
||||
deps,
|
||||
canvasRuntime,
|
||||
@@ -954,6 +957,7 @@ export async function startGatewayServer(
|
||||
broadcast,
|
||||
getState: () => ({
|
||||
hooksConfig,
|
||||
hookClientIpConfig,
|
||||
heartbeatRunner,
|
||||
cronState,
|
||||
browserControl,
|
||||
@@ -961,6 +965,7 @@ export async function startGatewayServer(
|
||||
}),
|
||||
setState: (nextState) => {
|
||||
hooksConfig = nextState.hooksConfig;
|
||||
hookClientIpConfig = nextState.hookClientIpConfig;
|
||||
heartbeatRunner = nextState.heartbeatRunner;
|
||||
cronState = nextState.cronState;
|
||||
cron = cronState.cron;
|
||||
|
||||
Reference in New Issue
Block a user