* Release the lock
()
| 590 | * Release the lock |
| 591 | */ |
| 592 | release(): void { |
| 593 | if (!this.held) return; |
| 594 | try { |
| 595 | // Only remove if we still own it (check PID) |
| 596 | const content = fs.readFileSync(this.lockPath, 'utf-8').trim(); |
| 597 | if (parseInt(content, 10) === process.pid) { |
| 598 | fs.unlinkSync(this.lockPath); |
| 599 | } |
| 600 | } catch { |
| 601 | // Lock file already gone - that's fine |
| 602 | } |
| 603 | this.held = false; |
| 604 | } |
| 605 | |
| 606 | /** |
| 607 | * Execute a function while holding the lock |
no outgoing calls
no test coverage detected