From a260145bc610ffd8a4299096836c037c3c3a5793 Mon Sep 17 00:00:00 2001 From: Floke Date: Fri, 6 Mar 2026 15:50:55 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20[30388f42]=20Befreie=20h=C3=A4ngende=20P?= =?UTF-8?q?ROCESSING=20Jobs=20im=20Re-Queueing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requeue_failed_jobs.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/requeue_failed_jobs.py b/requeue_failed_jobs.py index 99eb4183..bcd1107d 100644 --- a/requeue_failed_jobs.py +++ b/requeue_failed_jobs.py @@ -17,18 +17,18 @@ def main(): conn = sqlite3.connect(db_path) cursor = conn.cursor() - # Zaehlen, wie viele Jobs betroffen sind (FAILED und SKIPPED) - cursor.execute("SELECT COUNT(*) FROM jobs WHERE status IN ('FAILED', 'SKIPPED')") + # Zaehlen, wie viele Jobs betroffen sind (FAILED, SKIPPED, PROCESSING) + cursor.execute("SELECT COUNT(*) FROM jobs WHERE status IN ('FAILED', 'SKIPPED', 'PROCESSING')") count = cursor.fetchone()[0] if count == 0: - print("No failed or skipped jobs found to requeue.") + print("No failed, skipped or stuck processing jobs found to requeue.") return - print(f"Found {count} failed/skipped jobs in {db_path}. Re-queueing them for re-evaluation...") + print(f"Found {count} jobs (FAILED/SKIPPED/PROCESSING) in {db_path}. Re-queueing them for re-evaluation...") - # Alle FAILED- und SKIPPED-Jobs auf PENDING zuruecksetzen - cursor.execute("UPDATE jobs SET status = 'PENDING', error_msg = NULL WHERE status IN ('FAILED', 'SKIPPED')") + # Alle betroffenen Jobs auf PENDING zuruecksetzen + cursor.execute("UPDATE jobs SET status = 'PENDING', error_msg = NULL, next_try_at = NULL WHERE status IN ('FAILED', 'SKIPPED', 'PROCESSING')") conn.commit() print(f"✅ Success! {cursor.rowcount} jobs have been re-queued for processing.")