Skip to content

Commit 400e87c

Browse files
fix: align launchd polling with exit timeout
1 parent e2e9227 commit 400e87c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/daemon/launchd.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { execFileUtf8 } from "./exec-file.js";
2323
import { isCurrentProcessLaunchdServiceLabel } from "./launchd-current-service.js";
2424
import {
2525
buildLaunchAgentPlist as buildLaunchAgentPlistImpl,
26+
LAUNCH_AGENT_EXIT_TIMEOUT_SECONDS,
2627
readLaunchAgentProgramArgumentsFromFile,
2728
} from "./launchd-plist.js";
2829
import { scheduleDetachedLaunchdRestartHandoff } from "./launchd-restart-handoff.js";
@@ -50,7 +51,7 @@ const LAUNCH_AGENT_ENV_DIR_NAME = "service-env";
5051
const LAUNCH_AGENT_STDERR_PATH = "/dev/null";
5152
const OPENCLAW_UPDATE_LAUNCHD_LABEL_PREFIX = "ai.openclaw.update.";
5253
const OPENCLAW_MANUAL_UPDATE_LAUNCHD_LABEL_PATTERN = /^ai\.openclaw\.manual-update\.\d+$/;
53-
const LAUNCH_AGENT_STOP_PORT_RELEASE_TIMEOUT_MS = 2_000;
54+
const LAUNCH_AGENT_STOP_PORT_RELEASE_TIMEOUT_MS = LAUNCH_AGENT_EXIT_TIMEOUT_SECONDS * 1_000;
5455
const LAUNCH_AGENT_STOP_PORT_RELEASE_POLL_MS = 100;
5556

5657
export type StaleOpenClawUpdateLaunchdJob = {

0 commit comments

Comments
 (0)