(discoveredPids)
| 517 | } |
| 518 | |
| 519 | function 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 | |
| 539 | function stopPids(pids, options) { |
| 540 | var targets = Array.from(new Set(pids || [])).map(function(pid) { |
no test coverage detected