Appearance
job-queue
FreshSource: BIBLE.md (Phase 12 Phase 3, job-queue 6 routes, MAX_CONCURRENT=3)
Persistent task queue. Auto-retry, MAX_CONCURRENT=3. Survives server restarts.
Routes (6)
| Method | Route | What |
|---|---|---|
| POST | /jobs | Enqueue job |
| GET | /jobs | List jobs |
| GET | /jobs/:id | One job status |
| DELETE | /jobs/:id | Cancel pending job |
| POST | /jobs/:id/retry | Manually retry failed |
| GET | /jobs/stats | Queue depth, success rate |
Job states
stateDiagram-v2 [*] --> Pending Pending --> Running: Slot available Running --> Completed: Success Running --> Failed: Error Failed --> Pending: Auto-retry (max 3) Failed --> Dead: Retries exhausted
Example: enqueue a CTR job
bash
curl -X POST http://localhost:4700/jobs \
-H "Content-Type: application/json" \
-d '{
"type": "ctr",
"config": {
"keyword": "junk removal dallas",
"targetDomain": "journeyjunkremoval.com",
"city": "Dallas",
"state": "TX"
}
}'Returns { "jobId": "abc123" }.
Persistence
Jobs persisted at data/ghost-engine/jobs/{id}.json. Loaded on boot. Pending jobs continue from where they left off.
Concurrency limit
MAX_CONCURRENT=3. The queue runs at most 3 jobs simultaneously. Additional jobs wait in pending state.