forked from 0xWheatyz/SPARC
Persist async job state in PostgreSQL to survive API restarts #546
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. All job state (status, results, errors) is lost whenever the API process restarts, making async batch processing unreliable.What to do
jobstable in PostgreSQL (or a Redis key-value store) with columns:job_id,status,created_at,updated_at,result(JSONB),error.Acceptance Criteria
/jobsand/jobs/{id}endpoints return correct data after a restart.Reference
Roadmap item: P1 - Error handling and resilience > _jobs dict is in-memory only
Triage (Repo Manager): Assigned to AI-Engineer as @senior-developer task. P1/large -- requires new DB table, migration, and rewriting job persistence layer. Multi-file change with schema design decisions.
[Repo Manager] This issue is already resolved.
database.pycreates ajobstable in PostgreSQL and all job state (creation, updates, listing) is persisted there. The in-memory_jobsdict has been replaced. Closing as complete.