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

Method stop

lib/API.js:559–583  ·  view source on GitHub ↗

* Stop process * * @param {String} process_name Application Name / Process id / Application file / 'all' * @param {Function} cb Callback

(process_name, cb)

Source from the content-addressed store, hash-verified

557 * @param {Function} cb Callback
558 */
559 stop (process_name, cb) {
560 var that = this;
561
562 if (typeof(process_name) === 'number')
563 process_name = process_name.toString();
564
565 if (process_name == "-") {
566 process.stdin.resume();
567 process.stdin.setEncoding('utf8');
568 process.stdin.on('data', function (param) {
569 process.stdin.pause();
570 that.actionFromJson('stopProcessId', param, commander, 'pipe', (err, procs) => {
571 return cb ? cb(err, procs) : this.speedList()
572 })
573 });
574 }
575 else if (Common.isConfigFile(process_name))
576 that.actionFromJson('stopProcessId', process_name, commander, 'file', (err, procs) => {
577 return cb ? cb(err, procs) : this.speedList()
578 });
579 else
580 that._operate('stopProcessId', process_name, (err, procs) => {
581 return cb ? cb(err, procs) : this.speedList()
582 });
583 }
584
585 /**
586 * Get list of all processes managed

Callers 10

Worker.jsFile · 0.45
CLI.jsFile · 0.45
programmatic.jsFile · 0.45
watcher.jsFile · 0.45
id.mocha.jsFile · 0.45
namespace.mocha.jsFile · 0.45
lazy_api.mocha.jsFile · 0.45
signals.jsFile · 0.45
api.mocha.jsFile · 0.45

Calls 9

speedListMethod · 0.95
cbFunction · 0.85
toStringMethod · 0.80
actionFromJsonMethod · 0.80
_operateMethod · 0.80
resumeMethod · 0.65
setEncodingMethod · 0.65
onMethod · 0.65
pauseMethod · 0.65

Tested by

no test coverage detected