From 3d60ed0544e38ab9e3210cf01c6f72cd19a1192c Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Thu, 9 Apr 2026 08:17:53 +0100 Subject: [PATCH] fix(infra): split restart attempt types --- src/infra/restart.ts | 8 ++------ src/infra/restart.types.ts | 6 ++++++ src/infra/windows-task-restart.ts | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 src/infra/restart.types.ts diff --git a/src/infra/restart.ts b/src/infra/restart.ts index 748a6d7220c..3f0e9b50b16 100644 --- a/src/infra/restart.ts +++ b/src/infra/restart.ts @@ -8,14 +8,10 @@ import { } from "../daemon/constants.js"; import { createSubsystemLogger } from "../logging/subsystem.js"; import { cleanStaleGatewayProcessesSync, findGatewayPidsOnPortSync } from "./restart-stale-pids.js"; +import type { RestartAttempt } from "./restart.types.js"; import { relaunchGatewayScheduledTask } from "./windows-task-restart.js"; -export type RestartAttempt = { - ok: boolean; - method: "launchctl" | "systemd" | "schtasks" | "supervisor"; - detail?: string; - tried?: string[]; -}; +export type { RestartAttempt } from "./restart.types.js"; const SPAWN_TIMEOUT_MS = 2000; const SIGUSR1_AUTH_GRACE_MS = 5000; diff --git a/src/infra/restart.types.ts b/src/infra/restart.types.ts new file mode 100644 index 00000000000..7e82ca2bf14 --- /dev/null +++ b/src/infra/restart.types.ts @@ -0,0 +1,6 @@ +export type RestartAttempt = { + ok: boolean; + method: "launchctl" | "systemd" | "schtasks" | "supervisor"; + detail?: string; + tried?: string[]; +}; diff --git a/src/infra/windows-task-restart.ts b/src/infra/windows-task-restart.ts index 6bc2ed0b221..9709fa93d06 100644 --- a/src/infra/windows-task-restart.ts +++ b/src/infra/windows-task-restart.ts @@ -6,7 +6,7 @@ import { quoteCmdScriptArg } from "../daemon/cmd-argv.js"; import { resolveGatewayWindowsTaskName } from "../daemon/constants.js"; import { resolveTaskScriptPath } from "../daemon/schtasks.js"; import { formatErrorMessage } from "./errors.js"; -import type { RestartAttempt } from "./restart.js"; +import type { RestartAttempt } from "./restart.types.js"; import { resolvePreferredOpenClawTmpDir } from "./tmp-openclaw-dir.js"; const TASK_RESTART_RETRY_LIMIT = 12;