Renew the lock for as long as the job needs it
JavaScript’s withLock acquires the lease, renews at about a third of the TTL, and releases when the callback ends. If renewal fails, it aborts the signal passed to your callback. Check that signal in your callback and stop when it fires.
- Choose a TTL from 5 seconds to 90 days
- A held lock returns acquired: false without waiting
- A crashed holder’s unrenewed lease expires
await volcano.locks.withLock('nightly-rollup', { ttl: 30 }, run)acquired expires in 30s · fencing 4503599627370497renewed expires in 30srenewed expires in 30sreleased · the next run can take it