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

Function getOwnedLoopPids

src/ops/lifecycle.js:519–537  ·  view source on GitHub ↗
(discoveredPids)

Source from the content-addressed store, hash-verified

517}
518
519function getOwnedLoopPids(discoveredPids) {
520 var candidates = new Set();
521 function addPid(pid) {
522 var parsed = parseInt(pid, 10);
523 if (Number.isFinite(parsed) && parsed > 0) candidates.add(parsed);
524 }
525 (discoveredPids || []).forEach(addPid);
526 addPid(readPidFile(PID_FILE));
527 try {
528 var proxyPid = (readSettings().proxy || {}).pid;
529 addPid(proxyPid);
530 } catch (_) {}
531 return Array.from(candidates).filter(function(pid) {
532 if (!isPidRunning(pid)) return false;
533 var cmd = getCmdLine(pid);
534 if (isCurrentLoopCommand(cmd)) return true;
535 return isCurrentLoopCommand(cmd, getPidCwd(pid));
536 });
537}
538
539function stopPids(pids, options) {
540 var targets = Array.from(new Set(pids || [])).map(function(pid) {

Callers 3

startFunction · 0.85
stopOwnedLoopsFunction · 0.85
checkHealthFunction · 0.85

Calls 7

addPidFunction · 0.85
readPidFileFunction · 0.85
readSettingsFunction · 0.85
isPidRunningFunction · 0.85
getCmdLineFunction · 0.85
isCurrentLoopCommandFunction · 0.85
getPidCwdFunction · 0.85

Tested by

no test coverage detected