mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-25 02:29:42 +00:00
refactor(gateway): remove stale restart sentinel wake predicate
This commit is contained in:
@@ -646,10 +646,6 @@ export async function scheduleRestartSentinelWake(params: { deps: CliDeps }) {
|
||||
await scheduleRestartSentinelWakeAttempt({ ...params, attempt: 0 });
|
||||
}
|
||||
|
||||
export function shouldWakeFromRestartSentinel() {
|
||||
return !process.env.VITEST && process.env.NODE_ENV !== "test";
|
||||
}
|
||||
|
||||
export async function refreshLatestUpdateRestartSentinel(): Promise<RestartSentinelPayload | null> {
|
||||
const current = await readRestartSentinel();
|
||||
if (
|
||||
|
||||
@@ -38,7 +38,6 @@ const hoisted = vi.hoisted(() => {
|
||||
skipped: 0,
|
||||
}));
|
||||
const scheduleRestartAbortedMainSessionRecovery = vi.fn();
|
||||
const shouldWakeFromRestartSentinel = vi.fn(() => false);
|
||||
const scheduleRestartSentinelWake = vi.fn();
|
||||
const refreshLatestUpdateRestartSentinel = vi.fn<
|
||||
typeof import("./server-restart-sentinel.js").refreshLatestUpdateRestartSentinel
|
||||
@@ -91,7 +90,6 @@ const hoisted = vi.hoisted(() => {
|
||||
markStartupOrphanedMainSessionsForRecovery,
|
||||
recoverStartupOrphanedMainSessions,
|
||||
scheduleRestartAbortedMainSessionRecovery,
|
||||
shouldWakeFromRestartSentinel,
|
||||
scheduleRestartSentinelWake,
|
||||
refreshLatestUpdateRestartSentinel,
|
||||
getAcpRuntimeBackend,
|
||||
@@ -177,7 +175,6 @@ vi.mock("../acp/runtime/registry.js", () => ({
|
||||
vi.mock("./server-restart-sentinel.js", () => ({
|
||||
refreshLatestUpdateRestartSentinel: hoisted.refreshLatestUpdateRestartSentinel,
|
||||
scheduleRestartSentinelWake: hoisted.scheduleRestartSentinelWake,
|
||||
shouldWakeFromRestartSentinel: hoisted.shouldWakeFromRestartSentinel,
|
||||
}));
|
||||
|
||||
vi.mock("./server-startup-memory.js", () => ({
|
||||
@@ -327,7 +324,6 @@ describe("startGatewayPostAttachRuntime", () => {
|
||||
skipped: 0,
|
||||
});
|
||||
hoisted.scheduleRestartAbortedMainSessionRecovery.mockClear();
|
||||
hoisted.shouldWakeFromRestartSentinel.mockReturnValue(false);
|
||||
hoisted.scheduleRestartSentinelWake.mockClear();
|
||||
hoisted.getAcpRuntimeBackend.mockReset();
|
||||
hoisted.getAcpRuntimeBackend.mockReturnValue(null);
|
||||
|
||||
Reference in New Issue
Block a user