fix: [30388f42] Befreie hängende PROCESSING Jobs im Re-Queueing

This commit is contained in:
2026-03-06 15:50:55 +00:00
parent ec39cf5cd6
commit a260145bc6

View File

@@ -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.")