forked from 0xWheatyz/SPARC
Persist async job state in PostgreSQL to survive API restarts #1596
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?
Context
Roadmap item: P1 - Error handling and resilience
The
_jobsdict is in-memory only. Job state is lost whenever the API process restarts, causing users to lose track of in-progress or completed batch jobs.What to do
jobstable in PostgreSQL (job_id, status, created_at, updated_at, result_json, error)pending_jobsdict lookups with DB queriesAcceptance criteria
GET /jobs/{job_id}returns correct status after restartRef: ROADMAP.md P1 - Error handling and resilience
This issue is already resolved in main. Job state is persisted in PostgreSQL via
database.pymethods:create_job(),update_job(),list_jobs(), andmark_stale_jobs_failed(). The in-memory_jobsdict has been replaced.