Skip to content

NodeStorageLease

The lock-file StorageLease of Node: an exclusively created lock file holding the owner’s pid and host. A lock left by a process that no longer runs on this host is taken over, so a crash never needs manual cleanup.

Since v0.0.0


A lock-file lease: acquire(path) creates the file path (its directory must exist) holding this process’s pid and host, and removes it on release. An existing lock whose process is gone (same host, pid not running) or that is unreadable is stale and taken over; any other existing lock fails with StorageLeaseHeld, including one held by this process.

Signature

declare const lockFile: StorageLease

Source

Since v0.0.0