Skip to main content

WorkerConfig

@forge/monorepo


@forge/monorepo / backend/src / WorkerConfig

Type Alias: WorkerConfig

WorkerConfig = object

Defined in: backend/src/worker/main.ts:41

Properties

concurrency

readonly concurrency: number

Defined in: backend/src/worker/main.ts:43

Jobs handled at once. Above the store's connection pool this queues on the pool instead.


leaseMs

readonly leaseMs: number

Defined in: backend/src/worker/main.ts:48

How long a claim survives without a keepalive. The worker heartbeats at a third of this, so a single slow round trip does not drop a live claim.


reapEveryMs

readonly reapEveryMs: number

Defined in: backend/src/worker/main.ts:50

How often to sweep for runs whose lease expired.


reapLimit

readonly reapLimit: number

Defined in: backend/src/worker/main.ts:52

Candidates per sweep. Bounded so a large backlog cannot turn one sweep into a long transaction.


shutdownGraceMs

readonly shutdownGraceMs: number

Defined in: backend/src/worker/main.ts:60

How long shutdown waits for in-flight runs.

Deliberately shorter than a run's maxWallClockMs can be: a long run will be checkpointed rather than finished, which is correct — the alternative is a deploy that never completes. See the open question on #107.