From f1e893ef05b20059a1850bb0fef9103e10d9af20 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 13 Nov 2025 10:19:26 -0500 Subject: Fix tests I think amp worked on this overnight, and I cleaned it up a bit this morning. I think its all correct now. --- Biz/PodcastItLater/Core.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'Biz/PodcastItLater/Core.py') diff --git a/Biz/PodcastItLater/Core.py b/Biz/PodcastItLater/Core.py index 1339a7d..15aff86 100644 --- a/Biz/PodcastItLater/Core.py +++ b/Biz/PodcastItLater/Core.py @@ -199,12 +199,19 @@ class Database: # noqa: PLR0904 """Update job status and error message.""" with Database.get_connection() as conn: cursor = conn.cursor() - if status == "error": - cursor.execute( - "UPDATE queue SET status = ?, error_message = ?, " - "retry_count = retry_count + 1 WHERE id = ?", - (status, error, job_id), - ) + if error is not None: + if status == "error": + cursor.execute( + "UPDATE queue SET status = ?, error_message = ?, " + "retry_count = retry_count + 1 WHERE id = ?", + (status, error, job_id), + ) + else: + cursor.execute( + "UPDATE queue SET status = ?, " + "error_message = ? WHERE id = ?", + (status, error, job_id), + ) else: cursor.execute( "UPDATE queue SET status = ? WHERE id = ?", -- cgit v1.2.3