forked from 0xWheatyz/SPARC
Persist async job state in PostgreSQL instead of in-memory dict #641
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 that tracks batch job status is held purely in memory. When the API process restarts, all in-flight and completed job records are lost. This makes async batch results unreliable.What to do
jobstable in PostgreSQL (or use an existing schema migration system if one is present) with columns:job_id,status,created_at,updated_at,result(JSONB),error_jobswith database queriesGET /jobs/{id},GET /jobs) reflect persisted stateAcceptance criteria
Closing as already implemented. Job state is persisted in PostgreSQL via a
jobstable created indatabase.py. The API stores, updates, and queries job state from the database. Stale jobs are cleaned up on startup.