fix: [30388f42] Befreie hängende PROCESSING Jobs im Re-Queueing
This commit is contained in:
@@ -17,18 +17,18 @@ def main():
|
|||||||
conn = sqlite3.connect(db_path)
|
conn = sqlite3.connect(db_path)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
# Zaehlen, wie viele Jobs betroffen sind (FAILED und SKIPPED)
|
# Zaehlen, wie viele Jobs betroffen sind (FAILED, SKIPPED, PROCESSING)
|
||||||
cursor.execute("SELECT COUNT(*) FROM jobs WHERE status IN ('FAILED', 'SKIPPED')")
|
cursor.execute("SELECT COUNT(*) FROM jobs WHERE status IN ('FAILED', 'SKIPPED', 'PROCESSING')")
|
||||||
count = cursor.fetchone()[0]
|
count = cursor.fetchone()[0]
|
||||||
|
|
||||||
if count == 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
|
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
|
# Alle betroffenen Jobs auf PENDING zuruecksetzen
|
||||||
cursor.execute("UPDATE jobs SET status = 'PENDING', error_msg = NULL WHERE status IN ('FAILED', 'SKIPPED')")
|
cursor.execute("UPDATE jobs SET status = 'PENDING', error_msg = NULL, next_try_at = NULL WHERE status IN ('FAILED', 'SKIPPED', 'PROCESSING')")
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
print(f"✅ Success! {cursor.rowcount} jobs have been re-queued for processing.")
|
print(f"✅ Success! {cursor.rowcount} jobs have been re-queued for processing.")
|
||||||
|
|||||||
Reference in New Issue
Block a user