* Release the lock
()
| 282 | * Release the lock |
| 283 | */ |
| 284 | release(): void { |
| 285 | if (!this.held) return; |
| 286 | try { |
| 287 | // Only remove if we still own it (check PID) |
| 288 | const content = fs.readFileSync(this.lockPath, 'utf-8').trim(); |
| 289 | if (parseInt(content, 10) === process.pid) { |
| 290 | fs.unlinkSync(this.lockPath); |
| 291 | } |
| 292 | } catch { |
| 293 | // Lock file already gone - that's fine |
| 294 | } |
| 295 | this.held = false; |
| 296 | } |
| 297 | |
| 298 | /** |
| 299 | * Execute a function while holding the lock |
no outgoing calls
no test coverage detected