fix(download): 下载失败冷却日志补充失败原因和重试时间

将 _active_download_failure_fingerprints 返回类型从 Set[str] 改为 Dict[str, DownloadFailure],
__is_context_in_failure_cooldown 从失败记录中提取 error_message 和 next_retry_at,
日志输出格式改为「近期添加下载失败(失败原因:xxx),暂时跳过该资源,将于 yyyy-MM-dd HH:mm:ss 后重试」。
This commit is contained in:
jxxghp
2026-08-17 13:24:22 +08:00
parent 3ebbec3317
commit 2bb090d2be
2 changed files with 28 additions and 15 deletions
+5 -1
View File
@@ -921,7 +921,11 @@ def test_batch_download_skips_failed_subscription_resource_and_tries_next(monkey
"""
assert now_time
assert failed_fingerprint in fingerprints
return {failed_fingerprint: SimpleNamespace(fingerprint=failed_fingerprint)}
return {failed_fingerprint: SimpleNamespace(
fingerprint=failed_fingerprint,
error_message="无法读取种子文件",
next_retry_at="2026-01-02 03:04:05",
)}
monkeypatch.setattr(download_module, "DownloadFailureOper", _ActiveDownloadFailureOper)