MCPcopy Create free account
hub / github.com/PostHog/duckgres / NewWorkerCapacityExhaustedErrorForReason

Function NewWorkerCapacityExhaustedErrorForReason

controlplane/worker_pool.go:39–47  ·  view source on GitHub ↗
(reason configstore.WorkerClaimMissReason, retryAfter time.Duration)

Source from the content-addressed store, hash-verified

37}
38
39func NewWorkerCapacityExhaustedErrorForReason(reason configstore.WorkerClaimMissReason, retryAfter time.Duration) error {
40 if retryAfter <= 0 {
41 retryAfter = DefaultWorkerSpawnRetryAfter
42 }
43 if reason == configstore.WorkerClaimMissReasonNone {
44 reason = configstore.WorkerClaimMissReasonNoIdle
45 }
46 return &WorkerCapacityExhaustedError{RetryAfter: retryAfter, Reason: reason}
47}
48
49// WorkerPool abstracts the lifecycle and scheduling of Flight SQL workers.
50// Two implementations exist:

Calls

no outgoing calls

Tested by 1