diff options
| author | Ben Sima <ben@bsima.me> | 2025-11-13 10:19:26 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bsima.me> | 2025-11-13 11:20:17 -0500 |
| commit | f1e893ef05b20059a1850bb0fef9103e10d9af20 (patch) | |
| tree | 255128532a69d980beb6a589556c6da8b40e8081 /Biz/PodcastItLater/Core.py | |
| parent | 7dbeda5aafc56427777c31489a2554e546417530 (diff) | |
Fix tests I think
amp worked on this overnight, and I cleaned it up a bit this morning. I
think its all correct now.
Diffstat (limited to 'Biz/PodcastItLater/Core.py')
| -rw-r--r-- | Biz/PodcastItLater/Core.py | 19 |
1 files changed, 13 insertions, 6 deletions
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 = ?", |
