fix(infra): split restart attempt types

This commit is contained in:
Vincent Koc
2026-04-09 08:17:53 +01:00
parent 04f9cc9f6c
commit 3d60ed0544
3 changed files with 9 additions and 7 deletions

View File

@@ -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;

View File

@@ -0,0 +1,6 @@
export type RestartAttempt = {
ok: boolean;
method: "launchctl" | "systemd" | "schtasks" | "supervisor";
detail?: string;
tried?: string[];
};

View File

@@ -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;