refactor(database): Convert DATA_ROOT_DIR to Mutex

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2024-11-09 22:44:44 +11:00
parent 6bc64822df
commit 00b7179743
3 changed files with 16 additions and 8 deletions

View File

@ -151,7 +151,7 @@ impl GameDownloadAgent {
game_id: String,
) -> Result<(), GameDownloadError> {
let mut contexts = Vec::new();
let base_path = DATA_ROOT_DIR.join("games").join(game_id.clone()).clone();
let base_path = DATA_ROOT_DIR.lock().unwrap().join("games").join(game_id.clone()).clone();
create_dir_all(base_path.clone()).unwrap();
info!("Generating contexts");
for (raw_path, chunk) in manifest {