diff --git a/channels/telegram/src/main.rs b/channels/telegram/src/main.rs index 837a044..ec7aa66 100644 --- a/channels/telegram/src/main.rs +++ b/channels/telegram/src/main.rs @@ -221,7 +221,15 @@ async fn get_updates( error!("telegram photo: missing file_id in update {update_id}"); (caption, None) } else { - match download_telegram_file(client, token, file_id).await { + // Bound the download — HttpClient::request_timeout only covers + // send_request, not body collect, so an indefinitely-slow body + // would otherwise stall every subsequent poll. + let dl = tokio::time::timeout( + std::time::Duration::from_secs(60), + download_telegram_file(client, token, file_id), + ).await + .unwrap_or_else(|_| Err("download timed out after 60s".into())); + match dl { Ok(path) => (caption, Some(path)), Err(e) => { error!("telegram photo download failed (file_id={file_id}): {e}");