Skip to content

isBulkOperationLockStale

Decides whether a lease lock is stale, so whoever finds it may commit the leftovers and remove it.

The heartbeat is the rule; the reboot and crashed-process checks are only fast paths that shorten the wait, and neither can make a lock with a fresh heartbeat on another machine stale.

Import:

import { isBulkOperationLockStale } from '@mnaoumov/obsidian-lib/bulk-operation';

Signature:

function isBulkOperationLockStale(lock: BulkOperationLock, context: BulkOperationLockStalenessContext): boolean

Parameters:

Parameter Type Description
lock BulkOperationLock The lock record.
context BulkOperationLockStalenessContext The facts about this machine.

Returns: boolean — Whether the lock is stale.


Links to this page: