feat: clone cache to drop guard before writing to file cache

This commit is contained in:
Zynh Ludwig 2024-11-14 19:27:19 -08:00
parent a9d4bc8b09
commit 12b0feba96

View file

@ -78,7 +78,11 @@ async fn upload_to_zip(
let record = UploadRecord::new(archive_path);
records.insert(cache_name.clone(), record.clone());
cache::write_to_cache(&records)
let records_cache = records.clone();
// Manually drop the records mutex guard
drop(records);
cache::write_to_cache(&records_cache)
.await
.map_err(|err| (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()))?;