修改下载完成的条件,如果还有文件在下载不视为完成

This commit is contained in:
zqm
2026-04-28 14:38:51 +08:00
parent f03c8ec5d7
commit 2bb49bb685
3 changed files with 8 additions and 5 deletions

View File

@@ -0,0 +1,2 @@
set RUSTFLAGS=-C target-feature=+crt-static
cargo build --release

View File

@@ -2,7 +2,7 @@ extern crate winres;
fn main() {
let mut res = winres::WindowsResource::new();
res.set("FileVersion", "0.0.0.2");
res.set("ProductVersion", "0.0.0.1");
res.set("FileVersion", "0.0.0.3");
res.set("ProductVersion", "1.0.0.1");
res.compile().unwrap();
}

View File

@@ -1802,7 +1802,7 @@ async fn run_updater(debug_mode: bool) -> bool {
// 加载初始 URL
let server_url = resolve_ws_url();
// 扫描候选应用阶段3使用
// 每次运行都重新扫描候选应用阶段3使用
let app_candidates = get_app_candidates(debug_mode);
// 将候选应用保存到 ctx
@@ -2363,8 +2363,9 @@ async fn run_updater(debug_mode: bool) -> bool {
}
}
// 6. 检查是否所有应用都处理完成AllFile 收完 且 队列清空)
if pending_apps.is_empty() && ctx_clone.download_queue.lock().unwrap().is_empty() {
// 6. 检查是否所有应用都处理完成AllFile 收完 且 队列清空 且 没有正在下载
let is_downloading = *ctx_clone.is_downloading.lock().unwrap();
if pending_apps.is_empty() && ctx_clone.download_queue.lock().unwrap().is_empty() && !is_downloading {
log_print!("{} [AllFile] 所有应用文件同步完成,进入 Complete 阶段", ts);
*ctx_clone.current_phase.lock().unwrap() = UpdatePhase::Complete;
update_check_done_clone2.store(true, std::sync::atomic::Ordering::SeqCst);