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

Method delete

lib/API.js:526–551  ·  view source on GitHub ↗

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

(process_name, jsonVia, cb)

Source from the content-addressed store, hash-verified

524 * @param {Function} cb Callback
525 */
526 delete (process_name, jsonVia, cb) {
527 var that = this;
528
529 if (typeof(jsonVia) === "function") {
530 cb = jsonVia;
531 jsonVia = null;
532 }
533
534 if (typeof(process_name) === "number") {
535 process_name = process_name.toString();
536 }
537
538 if (jsonVia == 'pipe')
539 return that.actionFromJson('deleteProcessId', process_name, commander, 'pipe', (err, procs) => {
540 return cb ? cb(err, procs) : this.speedList()
541 });
542 if (Common.isConfigFile(process_name))
543 return that.actionFromJson('deleteProcessId', process_name, commander, 'file', (err, procs) => {
544 return cb ? cb(err, procs) : this.speedList()
545 });
546 else {
547 that._operate('deleteProcessId', process_name, (err, procs) => {
548 return cb ? cb(err, procs) : this.speedList()
549 });
550 }
551 }
552
553 /**
554 * Stop process

Callers 15

resetMethod · 0.80
deleteMetricMethod · 0.80
takeSnapshotMethod · 0.80
Worker.jsFile · 0.80
runFunction · 0.80
exitPM2Function · 0.80
CLI.jsFile · 0.80
cluster.mocha.jsFile · 0.80
programmatic.jsFile · 0.80
dump.mocha.jsFile · 0.80

Calls 5

speedListMethod · 0.95
cbFunction · 0.85
toStringMethod · 0.80
actionFromJsonMethod · 0.80
_operateMethod · 0.80

Tested by

no test coverage detected