From 37410ce216f25fbc4ae0f12dd8caabd48f0b4497 Mon Sep 17 00:00:00 2001 From: Connor Johnstone Date: Wed, 18 Mar 2026 15:20:13 -0400 Subject: [PATCH] Error handling changes --- src/queries/downloads.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/queries/downloads.rs b/src/queries/downloads.rs index 1c1c872..af07cc9 100644 --- a/src/queries/downloads.rs +++ b/src/queries/downloads.rs @@ -86,7 +86,8 @@ pub async fn retry_failed(db: &DatabaseConnection, id: i32) -> DbResult<()> { let mut active: ActiveModel = item.into(); active.status = Set(DownloadStatus::Pending); active.error_message = Set(None); - active.retry_count = Set(active.retry_count.unwrap() + 1); + let current_retries = active.retry_count.take().unwrap_or(0); + active.retry_count = Set(current_retries + 1); active.updated_at = Set(Utc::now().naive_utc()); active.update(db).await?; Ok(())