MCPcopy Create free account
hub / github.com/effect-app/libs / leaseActive

Function leaseActive

packages/infra/src/WorkflowEngineCosmos.ts:310–314  ·  view source on GitHub ↗
(state: ExecDoc, now: number)

Source from the content-addressed store, hash-verified

308 // --- Lease / claim ----------------------------------------------------
309
310 const leaseActive = (state: ExecDoc, now: number): boolean =>
311 state.worker !== undefined
312 && state.worker !== workerId
313 && state.leaseExpiresAt !== undefined
314 && Date.parse(state.leaseExpiresAt) > now
315
316 /**
317 * Try to claim a lease on `state`. Returns the updated doc on success, `None`

Callers 1

tryClaimFunction · 0.70

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…