claim_pending in crates/etl/src/processor.rs only selects WHERE status = 'downloaded'. If the processor crashes mid-run, any document stuck in 'processing' can never be picked up again without manual SQL intervention.
Fix: Add a timeout-based reset query that moves stale 'processing' rows back to 'downloaded' (e.g., WHERE status = 'processing' AND etl_started_at < NOW() - INTERVAL '1 hour') before claiming new work.
claim_pendingincrates/etl/src/processor.rsonly selectsWHERE status = 'downloaded'. If the processor crashes mid-run, any document stuck in'processing'can never be picked up again without manual SQL intervention.Fix: Add a timeout-based reset query that moves stale
'processing'rows back to'downloaded'(e.g.,WHERE status = 'processing' AND etl_started_at < NOW() - INTERVAL '1 hour') before claiming new work.