mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-23 00:41:17 +00:00
* fix(cron): run legacy cron store migration in gateway fast path * fix(cli): run gateway startup migrations * fix(gateway): guard startup migrations and config selection * fix(gateway): reconcile final startup environment * fix(gateway): preserve guarded startup env semantics * fix(gateway): guard service-mode recovery candidates * fix(config): reconcile normalized env precedence * fix(cli): clear replaced proxy signal handlers * fix(gateway): reject invalid final config * test(gateway): cover invalid future config reset guard * test(cli): remove unused recovery state
23 lines
732 B
TypeScript
23 lines
732 B
TypeScript
import type { OpenClawConfig } from "../../config/types.openclaw.js";
|
|
|
|
export type GatewayRunRuntimeHooks = {
|
|
releaseManagedProxy?: () => Promise<void> | void;
|
|
refreshManagedProxy?: (config: OpenClawConfig["proxy"]) => Promise<void> | void;
|
|
};
|
|
|
|
let activeGatewayRunRuntimeHooks: GatewayRunRuntimeHooks = {};
|
|
|
|
export function getGatewayRunRuntimeHooks(): GatewayRunRuntimeHooks {
|
|
return activeGatewayRunRuntimeHooks;
|
|
}
|
|
|
|
export function installGatewayRunRuntimeHooks(hooks: GatewayRunRuntimeHooks): () => void {
|
|
const previous = activeGatewayRunRuntimeHooks;
|
|
activeGatewayRunRuntimeHooks = hooks;
|
|
return () => {
|
|
if (activeGatewayRunRuntimeHooks === hooks) {
|
|
activeGatewayRunRuntimeHooks = previous;
|
|
}
|
|
};
|
|
}
|