Fix result files remove

This commit is contained in:
2024-05-13 13:35:32 +02:00
parent a07f3221b1
commit 0e1e72258c

View File

@@ -30,9 +30,7 @@ pub static TASK_RESULTS: Lazy<Cache<String, Task>> = Lazy::new(|| {
.max_capacity(2048)
.async_eviction_listener(|_key, value: Task, _reason| {
Box::pin(async move {
if let Some(result_filename) = value.result_filename {
let _ = tokio::fs::remove_file(format!("/tmp/{}", result_filename)).await;
}
let _ = tokio::fs::remove_file(format!("/tmp/{}", value.id)).await;
})
})
.build()