mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-26 08:31:55 +00:00
fix(cli): wait for process exit before restarting gateway on Windows (openclaw#27913) thanks @tda1017
Verified: - pnpm vitest src/cli/update-cli/restart-helper.test.ts - pnpm check - pnpm build Co-authored-by: tda1017 <95275462+tda1017@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -818,11 +818,15 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
||||
|
||||
let restartScriptPath: string | null = null;
|
||||
let refreshGatewayServiceEnv = false;
|
||||
const gatewayPort = resolveGatewayPort(
|
||||
configSnapshot.valid ? configSnapshot.config : undefined,
|
||||
process.env,
|
||||
);
|
||||
if (shouldRestart) {
|
||||
try {
|
||||
const loaded = await resolveGatewayService().isLoaded({ env: process.env });
|
||||
if (loaded) {
|
||||
restartScriptPath = await prepareRestartScript(process.env);
|
||||
restartScriptPath = await prepareRestartScript(process.env, gatewayPort);
|
||||
refreshGatewayServiceEnv = true;
|
||||
}
|
||||
} catch {
|
||||
@@ -903,7 +907,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
||||
result,
|
||||
opts,
|
||||
refreshServiceEnv: refreshGatewayServiceEnv,
|
||||
gatewayPort: resolveGatewayPort(configSnapshot.valid ? configSnapshot.config : undefined),
|
||||
gatewayPort,
|
||||
restartScriptPath,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user