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

Method restartExistingProcessName

lib/API.js:755–772  ·  view source on GitHub ↗

* If start start/restart application

(cb)

Source from the content-addressed store, hash-verified

753 * If start <app_name> start/restart application
754 */
755 function restartExistingProcessName(cb) {
756 if (!isNaN(script) ||
757 (typeof script === 'string' && script.indexOf('/') != -1) ||
758 (typeof script === 'string' && path.extname(script) !== ''))
759 return cb(null);
760
761 that.Client.getProcessIdByName(script, function(err, ids) {
762 if (err && cb) return cb(err);
763 if (ids.length > 0) {
764 that._operate('restartProcessId', script, opts, function(err, list) {
765 if (err) return cb(err);
766 Common.printOut(conf.PREFIX_MSG + 'Process successfully started');
767 return cb(true, list);
768 });
769 }
770 else return cb(null);
771 });
772 }
773
774 /**
775 * If start <namespace> start/restart namespace

Callers

nothing calls this directly

Calls 4

cbFunction · 0.85
indexOfMethod · 0.80
getProcessIdByNameMethod · 0.80
_operateMethod · 0.80

Tested by

no test coverage detected