MCPcopy Create free account
hub / github.com/EvoMap/evolver / _readLockPayload

Function _readLockPayload

index.js:608–620  ·  view source on GitHub ↗
(lockFile)

Source from the content-addressed store, hash-verified

606}
607
608function _readLockPayload(lockFile) {
609 try {
610 const raw = fs.readFileSync(lockFile, 'utf8').trim();
611 if (!raw) return null;
612 // Backward-compat: older lock files contained only the pid as text.
613 // Newer payloads are JSON {pid, uid, startedAt}.
614 if (raw[0] === '{') {
615 try { return JSON.parse(raw); } catch (_) { return null; }
616 }
617 const pid = parseInt(raw, 10);
618 return Number.isFinite(pid) && pid > 0 ? { pid: pid } : null;
619 } catch (_) { return null; }
620}
621
622function _lockPayload() {
623 return JSON.stringify({

Callers 3

acquireLockFunction · 0.85
releaseLockFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected