MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / parseLockPid

Function parseLockPid

apps/cli/src/daemon-state.ts:293–310  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

291 });
292
293const parseLockPid = (raw: string): number | null => {
294 let parsed: unknown;
295 try {
296 parsed = JSON.parse(raw);
297 } catch {
298 return null;
299 }
300
301 if (
302 typeof parsed !== "object" ||
303 parsed === null ||
304 typeof (parsed as Record<string, unknown>).pid !== "number"
305 ) {
306 return null;
307 }
308
309 return (parsed as Record<string, number>).pid;
310};
311
312export const acquireDaemonStartLock = (input: {
313 hostname: string;

Callers 1

acquireDaemonStartLockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected