Skip to main content

Class: RepoLease

Defined in: db/db.ts:1571

Disposable lease returned by GoatDB.acquireRepo. Holding it keeps a repository open (its idle timer is unscheduled); releasing it (via dispose(), a using block, or Symbol.dispose) re-arms the timer. Used by ManagedItem commits so an in-flight write prevents an idle close from tearing down the target repo; releasing it only updates liveness and reschedules the timer. dispose() is idempotent: disposing the same lease more than once does not release another holder's lease.

Implements​

  • Disposable

Constructors​

Constructor​

new RepoLease(repo, _release): RepoLease

Defined in: db/db.ts:1573

Parameters​

ParameterType
repoRepository
_release() => void

Returns​

RepoLease

Properties​

PropertyModifierTypeDefined in
reporeadonlyRepositorydb/db.ts:1574

Methods​

[dispose]()​

[dispose](): void

Defined in: db/db.ts:1586

Returns​

void

Implementation of​

Disposable.[dispose]


dispose()​

dispose(): void

Defined in: db/db.ts:1581

Releases the lease. Idempotent: repeat calls are no-ops, so disposing the same lease more than once never releases another holder's lease.

Returns​

void