harden article generation reliability
Deployment Config CI / Deployment Config (push) Successful in 24s
Backend CI / Backend (push) Successful in 14m12s

This commit is contained in:
2026-05-05 23:43:10 +08:00
parent 3c912949e4
commit 65e9b7e293
24 changed files with 1259 additions and 52 deletions
@@ -0,0 +1,9 @@
CREATE INDEX IF NOT EXISTS idx_generation_tasks_active_state_check
ON generation_tasks(updated_at DESC, id DESC)
WHERE article_id IS NOT NULL
AND status IN ('queued', 'running');
CREATE INDEX IF NOT EXISTS idx_generation_tasks_recent_completed_state_check
ON generation_tasks(updated_at DESC, id DESC)
WHERE article_id IS NOT NULL
AND status = 'completed';