-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlock-types.ts
More file actions
48 lines (43 loc) · 1.06 KB
/
lock-types.ts
File metadata and controls
48 lines (43 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* @file Public type surface for `process/lock-*` modules — the
* `ProcessLockOptions` bag accepted by `processLock.acquire` and
* `processLock.withLock`. Pure types, no runtime side effects.
*/
/**
* Lock acquisition options.
*/
export interface ProcessLockOptions {
/**
* Maximum number of retry attempts.
*
* @default 3
*/
retries?: number | undefined
/**
* Base delay between retries in milliseconds.
*
* @default 100
*/
baseDelayMs?: number | undefined
/**
* Maximum delay between retries in milliseconds.
*
* @default 1000
*/
maxDelayMs?: number | undefined
/**
* Stale lock timeout in milliseconds. Locks older than this are considered
* abandoned and can be reclaimed. Aligned with npm's npx locking strategy (5
* seconds).
*
* @default 5000 (5 seconds)
*/
staleMs?: number | undefined
/**
* Interval for touching lock file to keep it fresh in milliseconds. Set to 0
* to disable periodic touching.
*
* @default 2000 (2 seconds)
*/
touchIntervalMs?: number | undefined
}