Skip to content

Commit

Permalink
feat: 略微降低下载速度
Browse files Browse the repository at this point in the history
  • Loading branch information
lanyeeee committed Nov 25, 2024
1 parent 83ec812 commit 42e0e8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src-tauri/src/download_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ impl DownloadManager {
save_path.to_string_lossy().to_string(), // TODO: 把save_path.to_string_lossy().to_string()保存到一个变量里,像current一样
current,
);
// 每下载完一张图片,都休息100-500ms
let sleep_time = rand::thread_rng().gen_range(100..=500);
// 每下载完一张图片,都休息300-800ms
let sleep_time = rand::thread_rng().gen_range(300..=800);
tokio::time::sleep(Duration::from_millis(sleep_time)).await;
}
// 该章节的图片下载完成,释放permit,允许其他章节下载
Expand Down

0 comments on commit 42e0e8b

Please sign in to comment.