refactor(cron): drop duplicate active-job reset alias · openclaw/openclaw@d29c3a5
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -27,7 +27,7 @@ import {
|
27 | 27 | isCronActiveJobMarkerCurrent, |
28 | 28 | isCronJobActive, |
29 | 29 | markCronJobActive, |
30 | | -resetCronActiveJobsForTests, |
| 30 | +resetCronActiveJobs, |
31 | 31 | } from "./active-jobs.js"; |
32 | 32 | import { CronService } from "./service.js"; |
33 | 33 | import { |
@@ -90,7 +90,7 @@ async function createManualRunHarness(jobId: string) {
|
90 | 90 | |
91 | 91 | describe("cron activeJobIds — manual-run mark/clear", () => { |
92 | 92 | beforeEach(() => { |
93 | | -resetCronActiveJobsForTests(); |
| 93 | +resetCronActiveJobs(); |
94 | 94 | }); |
95 | 95 | |
96 | 96 | afterEach(() => { |
@@ -155,7 +155,7 @@ describe("cron activeJobIds — manual-run mark/clear", () => {
|
155 | 155 | |
156 | 156 | expect(isCronActiveJobMarkerCurrent(marker)).toBe(true); |
157 | 157 | |
158 | | -resetCronActiveJobsForTests(); |
| 158 | +resetCronActiveJobs(); |
159 | 159 | |
160 | 160 | expect(isCronActiveJobMarkerCurrent(marker)).toBe(false); |
161 | 161 | expect(isCronJobActive("manual-main-cutoff")).toBe(false); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -202,6 +202,3 @@ export function resetCronActiveJobs() {
|
202 | 202 | state.activeJobIds?.clear(); |
203 | 203 | notifyActiveCronJobWaitersIfEmpty(state); |
204 | 204 | } |
205 | | - |
206 | | -/** Clears process-global cron active-job state between tests. */ |
207 | | -export const resetCronActiveJobsForTests = resetCronActiveJobs; |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,7 +7,7 @@ import {
|
7 | 7 | createReplyOperation, |
8 | 8 | } from "../auto-reply/reply/reply-run-registry.js"; |
9 | 9 | import type { OpenClawConfig } from "../config/config.js"; |
10 | | -import { markCronJobActive, resetCronActiveJobsForTests } from "../cron/active-jobs.js"; |
| 10 | +import { markCronJobActive, resetCronActiveJobs } from "../cron/active-jobs.js"; |
11 | 11 | import { getActivePluginRegistry, setActivePluginRegistry } from "../plugins/runtime.js"; |
12 | 12 | import type { CommandLaneSnapshot } from "../process/command-queue.js"; |
13 | 13 | import { CommandLane } from "../process/lanes.js"; |
@@ -48,7 +48,7 @@ afterAll(() => {
|
48 | 48 | |
49 | 49 | beforeEach(() => { |
50 | 50 | resetSystemEventsForTest(); |
51 | | -resetCronActiveJobsForTests(); |
| 51 | +resetCronActiveJobs(); |
52 | 52 | replyRunRegistryTesting.resetReplyRunRegistry(); |
53 | 53 | }); |
54 | 54 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,7 +2,7 @@
|
2 | 2 | import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; |
3 | 3 | import type { AcpSessionStoreEntry } from "../acp/runtime/session-meta.js"; |
4 | 4 | import { startAcpSpawnParentStreamRelay } from "../agents/acp-spawn-parent-stream.js"; |
5 | | -import { resetCronActiveJobsForTests } from "../cron/active-jobs.js"; |
| 5 | +import { resetCronActiveJobs } from "../cron/active-jobs.js"; |
6 | 6 | import { |
7 | 7 | emitAgentEvent, |
8 | 8 | registerAgentRunContext, |
@@ -475,7 +475,7 @@ describe("task-registry", () => {
|
475 | 475 | resetSystemEventsForTest(); |
476 | 476 | resetHeartbeatWakeStateForTests(); |
477 | 477 | resetAgentRunContextForTest(); |
478 | | -resetCronActiveJobsForTests(); |
| 478 | +resetCronActiveJobs(); |
479 | 479 | resetActiveCronTaskRunsForTests(); |
480 | 480 | resetTaskRegistryControlRuntimeForTests(); |
481 | 481 | resetTaskRegistryDeliveryRuntimeForTests(); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。