Repair official collection and retire exhausted material tasks
Development CI / check-and-build (push) Successful in 2m59s
GitHub Git mirror / mirror (push) Successful in 6s
Development CI / deploy-development (push) Successful in 5s

This commit is contained in:
eezd committed 2026-11-05 13:30:05 +08:00
1 parent d5d350b7ec
commit d0c2beb9b3
23 files changed
+399 -35

No files matched your search

+29
View File
@@ -102,3 +102,32 @@ test("gap links preserve canonical pages and do not rewrite unrelated URLs", ()
assert.equal(collectionGaps(source)[0].url, url)
}
})
test("retired gaps retain evidence without an active warning", () => {
const source = {
enabled: true,
consecutive_failures: 0,
code: "doj",
name: "DOJ",
region_code: "US",
list_url: "https://www.justice.gov/",
interval_seconds: 60,
backfill_hours: 72,
last_success_at: null,
last_error: null,
paused_until: null,
supports_history: true,
history_target: null,
history_position: null,
history_done: false,
today_new: 0,
today_revised: 0,
total_items: 0,
process: { state: "running", pid: 1, started_at: null, next_run_at: "2026-11-05T00:00:00Z" },
collection_stats: { active_gaps: 0, document_gaps: 1, retired_count: 1 },
history_cursor: { document_retries: { old: { document: { url: "https://www.justice.gov/old" }, attempts: 3, next_at: 1, error: "HTTP 503", retired_at: "2026-11-05T00:00:00Z" } } }
} as SourceInfo
assert.equal(sourceStatus(source).text, "等待调度")
assert.equal(collectionGaps(source)[0].retired, true)
assert.equal(collectionGaps(source)[0].error, "HTTP 503")
})