MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / release

Method release

src/utils.ts:618–630  ·  view source on GitHub ↗

* Release the lock

()

Source from the content-addressed store, hash-verified

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

Callers 4

recreateMethod · 0.95
tryAcquireMethod · 0.95
withLockMethod · 0.95
withLockAsyncMethod · 0.95

Calls 1

readRegularFileSyncFunction · 0.90

Tested by

no test coverage detected