fix: get lock as late as possible

This commit is contained in:
Zynh Ludwig 2024-11-15 11:56:12 -08:00
parent b8d8b2918a
commit 47b72f6f04

View file

@ -74,8 +74,8 @@ async fn upload_to_zip(
.map_err(|err| (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()))?;
}
let mut records = state.records.lock().await;
let record = UploadRecord::new(archive_path);
let mut records = state.records.lock().await;
records.insert(cache_name.clone(), record.clone());
let records_cache = records.clone();