style(downloads): Abstracted queue system

TODO: Still need to cleanup the rest of the legacy code which used to use the queue system
Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2024-11-23 18:18:03 +11:00
parent 450bca9c5b
commit 76b0975bcc
5 changed files with 82 additions and 19 deletions

View File

@ -8,7 +8,7 @@ use md5::{Context, Digest};
use reqwest::blocking::Response;
use std::io::Read;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::{
fs::{File, OpenOptions},
io::{self, BufWriter, ErrorKind, Seek, SeekFrom, Write},
@ -125,6 +125,7 @@ pub fn download_game_chunk(
// If we're paused
if control_flag.get() == DownloadThreadControlFlag::Stop {
info!("Control flag is Stop");
progress.store(0, Ordering::Relaxed);
return Ok(false);
}