feat(settings): Added max_download_threads setting and separated settings from db

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2025-01-06 07:36:35 +11:00
parent 2822b7a593
commit 5ea47d733b
7 changed files with 154 additions and 29 deletions

View File

@ -246,10 +246,10 @@ impl GameDownloadAgent {
pub fn run(&self) -> Result<bool, ()> {
info!("downloading game: {}", self.id);
const DOWNLOAD_MAX_THREADS: usize = 1;
let max_download_threads = DB.borrow_data().unwrap().settings.max_download_threads;
let pool = ThreadPoolBuilder::new()
.num_threads(DOWNLOAD_MAX_THREADS)
.num_threads(max_download_threads)
.build()
.unwrap();