This commit is contained in:
2024-05-07 00:19:25 +02:00
parent d2fcf96695
commit 0976471562
2 changed files with 3 additions and 3 deletions

View File

@@ -32,7 +32,7 @@ pub struct MessageInfo {
pub static TEMP_FILES_CACHE: Lazy<Cache<i32, MessageId>> = Lazy::new(|| { pub static TEMP_FILES_CACHE: Lazy<Cache<i32, MessageId>> = Lazy::new(|| {
Cache::builder() 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) .max_capacity(4098)
.async_eviction_listener(|_data_id, message_id, _cause| { .async_eviction_listener(|_data_id, message_id, _cause| {
Box::pin(async move { Box::pin(async move {

View File

@@ -93,7 +93,7 @@ async fn download(Path((chat_id, message_id)): Path<(i64, i32)>) -> impl IntoRes
let data = match downloader { let data = match downloader {
Some(v) => v.get_async_read(), 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); let reader = ReaderStream::new(data);