fix(gateway): expire default node pending work · openclaw/openclaw@f6d432e
vincentkoc
·
2026-06-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -47,6 +47,7 @@ type DrainResult = {
|
47 | 47 | const DEFAULT_STATUS_ITEM_ID = "baseline-status"; |
48 | 48 | const DEFAULT_STATUS_PRIORITY: NodePendingWorkPriority = "default"; |
49 | 49 | const DEFAULT_PRIORITY: NodePendingWorkPriority = "normal"; |
| 50 | +const DEFAULT_PENDING_WORK_TTL_MS = 24 * 60 * 60_000; |
50 | 51 | const DEFAULT_MAX_ITEMS = 4; |
51 | 52 | const MAX_ITEMS = 10; |
52 | 53 | const PRIORITY_RANK: Record<NodePendingWorkPriority, number> = { |
@@ -121,11 +122,12 @@ function makeBaselineStatusItem(nowMs: number): NodePendingWorkItem {
|
121 | 122 | }; |
122 | 123 | } |
123 | 124 | |
124 | | -function resolvePendingWorkExpiresAtMs(expiresInMs: unknown, nowMs: number): number | null { |
125 | | -if (typeof expiresInMs !== "number" || !Number.isFinite(expiresInMs)) { |
126 | | -return null; |
127 | | -} |
128 | | -return resolveExpiresAtMsFromDurationMs(Math.max(1_000, Math.trunc(expiresInMs)), { nowMs }) ?? 0; |
| 125 | +function resolvePendingWorkExpiresAtMs(expiresInMs: unknown, nowMs: number): number { |
| 126 | +const ttlMs = |
| 127 | +typeof expiresInMs === "number" && Number.isFinite(expiresInMs) |
| 128 | + ? Math.max(1_000, Math.trunc(expiresInMs)) |
| 129 | + : DEFAULT_PENDING_WORK_TTL_MS; |
| 130 | +return resolveExpiresAtMsFromDurationMs(ttlMs, { nowMs }) ?? 0; |
129 | 131 | } |
130 | 132 | |
131 | 133 | export function enqueueNodePendingWork(params: { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。