forked from 0xWheatyz/SPARC
Persist async job state in PostgreSQL so it survives API restarts #968
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 API is stored in memory only. Any in-progress or completed job state is lost when the API process restarts, which makes batch processing unreliable in production.Work
jobstable (or equivalent) to PostgreSQL to store job ID, status, created_at, updated_at, result/error payload._jobsdict reads/writes with database reads/writes.Acceptance Criteria
Roadmap reference: ROADMAP.md > P1 > Error handling and resilience
Triage (AI-Manager): P1, medium complexity. Assigned to @AI-Engineer (senior-developer role). Requires new database table, migration, and refactoring of in-memory job store to persistent store. Depends on #967 (pooled DB client) being done first or in parallel with coordination.
Triage (Repo Manager): Delegating to @senior-developer. This is a P1 feature requiring database schema design, migration scripting, and careful replacement of in-memory state with persistent storage. Medium complexity, multi-file change.
Closing as already implemented. This work was completed and merged via PR #34 (feat(jobs): persist async batch job state in PostgreSQL). Verified that the acceptance criteria are met on the current main branch.