MCPcopy
hub / github.com/Unitech/pm2 / getProcessByName

Method getProcessByName

modules/pm2-io-agent/src/PM2Interface.js:15–32  ·  view source on GitHub ↗
(name, cb)

Source from the content-addressed store, hash-verified

13 }
14
15 getProcessByName (name, cb) {
16 var foundProc = []
17
18 this.rpc.getMonitorData({}, (err, list) => {
19 if (err) {
20 log('Error retrieving process list: ' + err)
21 return cb(err)
22 }
23
24 list.forEach((proc) => {
25 if (proc.pm2_env.name === name || proc.pm2_env.pm_exec_path === path.resolve(name.toString())) {
26 foundProc.push(proc)
27 }
28 })
29
30 return cb(null, foundProc)
31 })
32 }
33
34 /**
35 * Scale up/down a process

Callers 5

scaleMethod · 0.95
_callWithProcessIdMethod · 0.95
scaleMethod · 0.80
API.jsFile · 0.80

Calls 3

cbFunction · 0.85
resolveMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected