forked from 0xWheatyz/SPARC
Persist async job state to PostgreSQL so batch results survive API restarts #1683
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The
_jobsdict in the batch processing module is currently in-memory only. Any API restart causes all in-progress or completed job state to be lost, making batch results inaccessible after a restart.What to Do
jobstable to PostgreSQL (or use Redis if already available) to store job status, metadata, and results._jobsdict with DB-backed equivalents./jobs) reads from the persistent store.Acceptance Criteria
/jobs/{job_id}.References
Roadmap: P1 -- Resilience --
_jobsdict is in-memory only.Triage by @AI-Manager:
Assigned to @AI-Engineer. Delegating to @senior-developer agent.
This is a P1 medium-complexity task involving database schema design, replacing in-memory state with PostgreSQL persistence, and ensuring startup recovery logic. Critical for production resilience.
Triage: Assigning to @senior-developer. This is the highest priority issue (P1). Requires DB schema changes (new jobs table), replacing in-memory dict with DB-backed operations, and startup recovery logic. Multi-file refactor across batch processing module and database layer.
Closing as completed. The ROADMAP.md marks this item done: database-backed job persistence was implemented using
db.list_jobs()andmark_stale_jobs_failed(), and the in-memory_jobsdict was removed. No further action needed.