From 28e9ce5a6fb4afdd06535b512f4f02d4aa39a5d7 Mon Sep 17 00:00:00 2001 From: Yuyi-Oak <1722157266@qq.com> Date: Thu, 16 Jul 2026 09:21:16 -0700 Subject: [PATCH] =?UTF-8?q?refactor(official-sync):=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E8=AF=AF=E5=AF=BC=E6=80=A7=E7=9A=84=20skipped=5Fthis=5Frun=20?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=B9=B6=E4=BF=AE=E6=AD=A3=E6=8E=AA=E8=BE=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit quarantine 条目的 skipped_this_run 字段恒写 true、仅测试读取、不参与任何逻辑, 且名称误导——下载失败是 fail-fast 中止整轮,并非“跳过该 URL 继续”。删除该字段, 并把失败消息中的“跳过本轮”改为“中止本轮同步、不发布不完整资源”以消除歧义。 (quarantine 为瞬时状态文件且未启用 deny_unknown_fields,旧文件多出的键会被忽略。) 对应 issue #18 维护清单 3-2。 Co-Authored-By: Claude Fable 5 --- infrastructure/src/official_download.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/infrastructure/src/official_download.rs b/infrastructure/src/official_download.rs index dce51bf..c29f158 100644 --- a/infrastructure/src/official_download.rs +++ b/infrastructure/src/official_download.rs @@ -575,7 +575,7 @@ impl OfficialResourcePullService { &error, )); return Err(format!( - "官方资源下载中断:URL 已进入 quarantine 并跳过本轮,不会发布不完整资源;url={url} quarantine={};{}", + "官方资源下载失败:URL 已进入 quarantine,中止本轮同步、不发布不完整资源;url={url} quarantine={};{}", self.download_quarantine_path().display(), error.message )); @@ -1059,7 +1059,6 @@ impl OfficialResourcePullService { failure_kind: error.failure_kind().map(ToOwned::to_owned), http_status: error.http_status(), retryable: error.retryable(), - skipped_this_run: true, last_error: error.message.clone(), }, ); @@ -1508,7 +1507,6 @@ struct OfficialDownloadQuarantineEntry { failure_kind: Option, http_status: Option, retryable: Option, - skipped_this_run: bool, last_error: String, } @@ -2826,7 +2824,6 @@ exit 22 assert_eq!(entry.failure_kind.as_deref(), Some("http_not_found")); assert_eq!(entry.retryable, Some(false)); assert_eq!(entry.attempts, 1); - assert!(entry.skipped_this_run); assert!(service.read_download_manifest().unwrap().entries.is_empty()); }