refactor(agents): remove stale lane auto-resume helper · openclaw/openclaw@95b6df8
vincentkoc
·
2026-06-18
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -40,10 +40,10 @@ async function suspendLane(ttlMs: number, cfg: OpenClawConfig, laneId: CommandLa
|
40 | 40 | |
41 | 41 | describe("session suspension", () => { |
42 | 42 | afterEach(async () => { |
43 | | -const { cancelLaneAutoResume } = await import("./session-suspension.js"); |
44 | | -cancelLaneAutoResume(CommandLane.Main); |
45 | | -cancelLaneAutoResume(CommandLane.Cron); |
46 | | -cancelLaneAutoResume(CommandLane.CronNested); |
| 43 | +if (vi.isFakeTimers()) { |
| 44 | + await vi.runOnlyPendingTimersAsync(); |
| 45 | + vi.clearAllTimers(); |
| 46 | +} |
47 | 47 | vi.useRealTimers(); |
48 | 48 | sessionStoreMocks.applySessionStoreEntryPatch.mockClear(); |
49 | 49 | commandQueueMocks.setCommandLaneConcurrency.mockClear(); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -107,14 +107,6 @@ function scheduleLaneAutoResume(laneId: string, delayMs: number, resumeConcurren
|
107 | 107 | laneResumeTimers.set(laneId, timer); |
108 | 108 | } |
109 | 109 | |
110 | | -export function cancelLaneAutoResume(laneId: string) { |
111 | | -const existing = laneResumeTimers.get(laneId); |
112 | | -if (existing) { |
113 | | -clearTimeout(existing); |
114 | | -laneResumeTimers.delete(laneId); |
115 | | -} |
116 | | -} |
117 | | - |
118 | 110 | export async function suspendSession(params: SessionSuspensionParams) { |
119 | 111 | if (!params.cfg) { |
120 | 112 | return; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。