MCPcopy Create free account
hub / github.com/amrkmn/x / isProcessRunning

Function isProcessRunning

scripts/cache/lock.ts:24–32  ·  view source on GitHub ↗

* Checks if a process is still running (only works on same machine). * Uses Node.js process.kill(pid, 0) which doesn't actually kill but checks existence.

(pid: number)

Source from the content-addressed store, hash-verified

22 * Uses Node.js process.kill(pid, 0) which doesn't actually kill but checks existence.
23 */
24function isProcessRunning(pid: number): boolean {
25 try {
26 // Signal 0 doesn't kill, just checks if process exists
27 process.kill(pid, 0);
28 return true;
29 } catch {
30 return false;
31 }
32}
33
34/**
35 * Checks if a lock is stale based on Restic's algorithm:

Callers 1

isLockStaleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected