feat(jobs): Postgres job queue, worker mode and seat sweep (#29) #95
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/kws!95
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/29-job-queue-worker"
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?
Closes #29. A Postgres job queue,
KWS_MODE=worker, and the seat-hold sweep that checkout (#26) depends on (ADR 0010).What's in it
jobsand append-onlydead_jobsinternal/jobs+pgstore:FOR UPDATE SKIP LOCKEDclaims under a 5 min lease, fencedComplete/Fail(id + worker + attempt), retries with backoff (5 s x 2^n, cap 15 min, 5 attempts), dead letters, poison-job dead-lettering, queue depthseats.ReleaseExpired: sweep through the samesettlecode asRelease(skips payment-pending and locked holds), batches of 50seats.sweepevery 1 min,idempotency.purgeevery 1 h (7-day window),/healthz,/readyz,/metrics(queue depth), exits non-zero if the runner diesVerification
make cover: 94.2% total (minimum 80%)go test ./... -race,make lint,make contract: cleanNeeds attention
deploy/has no api service yet, so no worker service was added.dead_jobsreplay/retention tool; alert onincrease(kws_jobs_dead[15m]) > 0, not> 0.KWS_HTTP_ADDRdefaults to:8080in both modes: API and worker collide when run side by side locally.🤖 Generated with Claude Code