* Release the lock
()
| 614 | * Release the lock |
| 615 | */ |
| 616 | release(): void { |
| 617 | if (!this.held) return; |
| 618 | try { |
| 619 | // Only remove if we still own it (check PID) |
| 620 | const content = fs.readFileSync(this.lockPath, 'utf-8').trim(); |
| 621 | if (parseInt(content, 10) === process.pid) { |
| 622 | fs.unlinkSync(this.lockPath); |
| 623 | } |
| 624 | } catch { |
| 625 | // Lock file already gone - that's fine |
| 626 | } |
| 627 | this.held = false; |
| 628 | } |
| 629 | |
| 630 | /** |
| 631 | * Execute a function while holding the lock |
no outgoing calls
no test coverage detected