mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
fix(infra): split restart attempt types
This commit is contained in:
@@ -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;
|
||||
|
||||
6
src/infra/restart.types.ts
Normal file
6
src/infra/restart.types.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export type RestartAttempt = {
|
||||
ok: boolean;
|
||||
method: "launchctl" | "systemd" | "schtasks" | "supervisor";
|
||||
detail?: string;
|
||||
tried?: string[];
|
||||
};
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user