diff --git a/app.py b/app.py index 0054143..1a78c28 100644 --- a/app.py +++ b/app.py @@ -440,7 +440,8 @@ def triage_submission(db, submission_id: int) -> dict: db.execute( """UPDATE submissions SET triage_tier=?, triage_reasons=?, triage_at=CURRENT_TIMESTAMP, - public=?, status=?, display_text=? + public=?, status=?, display_text=?, + published_at=CASE WHEN ? = 1 THEN COALESCE(published_at, CURRENT_TIMESTAMP) ELSE published_at END WHERE id=?""", ( tier, @@ -448,6 +449,7 @@ def triage_submission(db, submission_id: int) -> dict: 1 if tier == 1 else 0, "published" if tier == 1 else ("blocked" if tier == 3 else "pending"), display_text, + tier, submission_id, ), ) @@ -481,7 +483,7 @@ def _run_triage_async(submission_id: int): import time as _time import sqlite3 as _sqlite3 - THREAD_WINDOW_SEC = 360 # 6 Minuten (5 Min Thread-Window + 1 Min Puffer) + THREAD_WINDOW_SEC = int(os.environ.get("TRIAGE_DELAY_SECONDS", "360")) # default: 6 Min print(f"[triage] #{submission_id} geplant in {THREAD_WINDOW_SEC}s", file=sys.stderr) _time.sleep(THREAD_WINDOW_SEC) @@ -1316,6 +1318,8 @@ def admin_dashboard(): reasons = json.loads(r["triage_reasons"] or "[]") tooltip = " | ".join(reasons) if reasons else "Keine Details" triage_badge = f'{emoji}' + else: + triage_badge = '⏳' table_rows += f"""