mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-25 22:21:43 +00:00
fix(gateway): trace restart intent reasons
This commit is contained in:
@@ -346,7 +346,10 @@ describe("runServiceRestart token drift", () => {
|
||||
|
||||
await runServiceRestart(createServiceRunArgs());
|
||||
|
||||
expect(writeGatewayRestartIntentSync).toHaveBeenCalledWith({ targetPid: 1234 });
|
||||
expect(writeGatewayRestartIntentSync).toHaveBeenCalledWith({
|
||||
targetPid: 1234,
|
||||
reason: "gateway.restart",
|
||||
});
|
||||
expect(clearGatewayRestartIntentSync).not.toHaveBeenCalled();
|
||||
expect(service.restart).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
@@ -366,6 +369,7 @@ describe("runServiceRestart token drift", () => {
|
||||
|
||||
expect(writeGatewayRestartIntentSync).toHaveBeenCalledWith({
|
||||
targetPid: 1234,
|
||||
reason: "gateway.restart",
|
||||
intent: {
|
||||
waitMs: 2_500,
|
||||
},
|
||||
@@ -379,7 +383,10 @@ describe("runServiceRestart token drift", () => {
|
||||
|
||||
await expect(runServiceRestart(createServiceRunArgs())).rejects.toThrow("__exit__:1");
|
||||
|
||||
expect(writeGatewayRestartIntentSync).toHaveBeenCalledWith({ targetPid: 1234 });
|
||||
expect(writeGatewayRestartIntentSync).toHaveBeenCalledWith({
|
||||
targetPid: 1234,
|
||||
reason: "gateway.restart",
|
||||
});
|
||||
expect(clearGatewayRestartIntentSync).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
|
||||
@@ -574,6 +574,7 @@ export async function runServiceRestart(params: {
|
||||
const runtime = await params.service.readRuntime(process.env).catch(() => null);
|
||||
wroteRestartIntent = writeGatewayRestartIntentSync({
|
||||
targetPid: runtime?.pid,
|
||||
reason: "gateway.restart",
|
||||
...(restartIntent ? { intent: restartIntent } : {}),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -208,6 +208,7 @@ async function restartGatewayWithoutServiceManager(
|
||||
}
|
||||
writeGatewayRestartIntentSync({
|
||||
targetPid: pids[0],
|
||||
reason: "gateway.restart",
|
||||
...(restartIntent ? { intent: restartIntent } : {}),
|
||||
});
|
||||
signalVerifiedGatewayPidSync(pids[0], "SIGUSR1");
|
||||
|
||||
Reference in New Issue
Block a user