Kind: Class
Source: atloria-monorepo/apps/api/src/docs-repo/committer.worker.ts
CommitterWorker — the single, gated consumer of the 'docs-repo' queue.
Only spins up where DOCS_REPO_WORKER==='true' (a dedicated 1-replica deployment); api pods enqueue-only. Concurrency 1 per project is enforced by the FAIL-CLOSED commit lock, not by BullMQ groups: a job takes the per-project lock, drains that project's outbox, writes a single coalesced commit (DB-wins rebuild), then marks the drained rows processed. If the lock is held (another commit in flight) or Redis is down (fail-closed), the job is re-delayed rather than committing.
Implements: OnModuleInit, OnModuleDestroy
Methods
| Method | Signature | Returns |
|---|---|---|
onModuleInit | onModuleInit() | void |
commitUnderLock | commitUnderLock(projectId: string) | `Promise<string |
commitProject | commitProject(projectId: string) | `Promise<string |
onModuleDestroy | onModuleDestroy() | Promise<void> |
Where it refuses work
CommitterWorkerstops the work with an early return whenpending.length === 0.CommitterWorkerstops the work with an early return whenhumanIds.length === 0.CommitterWorkerstops the work with an early return whenhumans.length === 0.CommitterWorkerstops the work with an early return whenhumanIds.length === 1.
When something fails
CommitterWorkerhandles failure in 4 places: it lets it reach the caller in 3, and turns it into a return value in 1.
Referenced By
DocsRepoModule(MODULE_PROVIDES)
Was this page helpful?