From 09764715628b9762acfa7e38989cf2d0e4b8e313 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Tue, 7 May 2024 00:19:25 +0200 Subject: [PATCH] Fix --- src/core/file_utils.rs | 4 ++-- src/core/views.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/file_utils.rs b/src/core/file_utils.rs index ecb91a5..702a20a 100644 --- a/src/core/file_utils.rs +++ b/src/core/file_utils.rs @@ -32,7 +32,7 @@ pub struct MessageInfo { pub static TEMP_FILES_CACHE: Lazy> = Lazy::new(|| { Cache::builder() - .time_to_idle(std::time::Duration::from_secs(16)) + .time_to_idle(std::time::Duration::from_secs(5 * 60 * 60)) .max_capacity(4098) .async_eviction_listener(|_data_id, message_id, _cause| { Box::pin(async move { @@ -98,7 +98,7 @@ pub async fn download_file(chat_id: i64, message_id: i32) -> Option) -> impl IntoRes let data = match downloader { Some(v) => v.get_async_read(), - None => return StatusCode::NOT_FOUND.into_response() + None => return StatusCode::BAD_REQUEST.into_response() }; let reader = ReaderStream::new(data);