Skip to content

Commit aeeb4bd

Browse files
committed
fix(gateway): remove continue statements and add HTTP status checks in telegram adapter
1 parent 804d643 commit aeeb4bd

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

gateway/src/adapters/telegram.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,15 @@ pub async fn webhook(
118118
if let Ok(resp) = client.get(url).send().await {
119119
if !resp.status().is_success() {
120120
warn!(status = %resp.status(), id = %file_id, "Telegram getFile failed");
121-
continue;
122121
} else if let Ok(body) = resp.json::<serde_json::Value>().await {
123122
if let Some(file_path) = body["result"]["file_path"].as_str() {
124123
// 2. Download the file
125124
let download_url = format!("{TELEGRAM_API_BASE}/file/bot{token}/{file_path}");
126125
if let Ok(r) = client.get(download_url).send().await {
127126
if !r.status().is_success() {
128127
warn!(status = %r.status(), id = %file_id, "failed to download Telegram media");
129-
continue;
130-
}
131-
// Issue #690 review fix: Check file size before downloading
128+
} else {
129+
// Issue #690 review fix: Check file size before downloading
132130
let content_length = r
133131
.headers()
134132
.get("content-length")

0 commit comments

Comments
 (0)