Skip to content

Commit 3d60ed0

Browse files
committed
fix(infra): split restart attempt types
1 parent 04f9cc9 commit 3d60ed0

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/infra/restart.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ import {
88
} from "../daemon/constants.js";
99
import { createSubsystemLogger } from "../logging/subsystem.js";
1010
import { cleanStaleGatewayProcessesSync, findGatewayPidsOnPortSync } from "./restart-stale-pids.js";
11+
import type { RestartAttempt } from "./restart.types.js";
1112
import { relaunchGatewayScheduledTask } from "./windows-task-restart.js";
1213

13-
export type RestartAttempt = {
14-
ok: boolean;
15-
method: "launchctl" | "systemd" | "schtasks" | "supervisor";
16-
detail?: string;
17-
tried?: string[];
18-
};
14+
export type { RestartAttempt } from "./restart.types.js";
1915

2016
const SPAWN_TIMEOUT_MS = 2000;
2117
const SIGUSR1_AUTH_GRACE_MS = 5000;

src/infra/restart.types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export type RestartAttempt = {
2+
ok: boolean;
3+
method: "launchctl" | "systemd" | "schtasks" | "supervisor";
4+
detail?: string;
5+
tried?: string[];
6+
};

src/infra/windows-task-restart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { quoteCmdScriptArg } from "../daemon/cmd-argv.js";
66
import { resolveGatewayWindowsTaskName } from "../daemon/constants.js";
77
import { resolveTaskScriptPath } from "../daemon/schtasks.js";
88
import { formatErrorMessage } from "./errors.js";
9-
import type { RestartAttempt } from "./restart.js";
9+
import type { RestartAttempt } from "./restart.types.js";
1010
import { resolvePreferredOpenClawTmpDir } from "./tmp-openclaw-dir.js";
1111

1212
const TASK_RESTART_RETRY_LIMIT = 12;

0 commit comments

Comments
 (0)