(file: string)
| 115 | } |
| 116 | |
| 117 | async function stats(file: string) { |
| 118 | try { |
| 119 | return await stat(file) |
| 120 | } catch (err) { |
| 121 | const errCode = code(err) |
| 122 | if (errCode === "ENOENT" || errCode === "ENOTDIR") return |
| 123 | throw err |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | async function stale(lockDir: string, heartbeatPath: string, metaPath: string, staleMs: number) { |
| 128 | // Stale detection allows automatic recovery after crashed owners. |
no test coverage detected