mirror of
https://github.com/flibusta-apps/batch_downloader.git
synced 2025-12-06 06:15:37 +01:00
Fix result files remove
This commit is contained in:
@@ -30,9 +30,7 @@ pub static TASK_RESULTS: Lazy<Cache<String, Task>> = Lazy::new(|| {
|
|||||||
.max_capacity(2048)
|
.max_capacity(2048)
|
||||||
.async_eviction_listener(|_key, value: Task, _reason| {
|
.async_eviction_listener(|_key, value: Task, _reason| {
|
||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
if let Some(result_filename) = value.result_filename {
|
let _ = tokio::fs::remove_file(format!("/tmp/{}", value.id)).await;
|
||||||
let _ = tokio::fs::remove_file(format!("/tmp/{}", result_filename)).await;
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.build()
|
.build()
|
||||||
|
|||||||
Reference in New Issue
Block a user