mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 23:38:27 +00:00
refactor: unify restart gating and update availability sync
This commit is contained in:
@@ -2,6 +2,7 @@ import { getActiveEmbeddedRunCount } from "../agents/pi-embedded-runner/runs.js"
|
||||
import { getTotalPendingReplies } from "../auto-reply/reply/dispatcher-registry.js";
|
||||
import type { CliDeps } from "../cli/deps.js";
|
||||
import { resolveAgentMaxConcurrent, resolveSubagentMaxConcurrent } from "../config/agent-limits.js";
|
||||
import { isRestartEnabled } from "../config/commands.js";
|
||||
import type { loadConfig } from "../config/config.js";
|
||||
import { startGmailWatcherWithLogs } from "../hooks/gmail-watcher-lifecycle.js";
|
||||
import { stopGmailWatcher } from "../hooks/gmail-watcher.js";
|
||||
@@ -48,7 +49,7 @@ export function createGatewayReloadHandlers(params: {
|
||||
plan: GatewayReloadPlan,
|
||||
nextConfig: ReturnType<typeof loadConfig>,
|
||||
) => {
|
||||
setGatewaySigusr1RestartPolicy({ allowExternal: nextConfig.commands?.restart === true });
|
||||
setGatewaySigusr1RestartPolicy({ allowExternal: isRestartEnabled(nextConfig) });
|
||||
const state = params.getState();
|
||||
const nextState = { ...state };
|
||||
|
||||
@@ -138,7 +139,7 @@ export function createGatewayReloadHandlers(params: {
|
||||
plan: GatewayReloadPlan,
|
||||
nextConfig: ReturnType<typeof loadConfig>,
|
||||
) => {
|
||||
setGatewaySigusr1RestartPolicy({ allowExternal: nextConfig.commands?.restart === true });
|
||||
setGatewaySigusr1RestartPolicy({ allowExternal: isRestartEnabled(nextConfig) });
|
||||
const reasons = plan.restartReasons.length
|
||||
? plan.restartReasons.join(", ")
|
||||
: plan.changedPaths.join(", ");
|
||||
|
||||
Reference in New Issue
Block a user