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

Function restartExistingProcessName

examples/sourcemap-auto-resolve/API.js:668–694  ·  view source on GitHub ↗

* If start start/restart application

(cb)

Source from the content-addressed store, hash-verified

666 * If start <app_name> start/restart application
667 */
668 function restartExistingProcessName(cb) {
669 if (!isNaN(script) ||
670 (typeof script === 'string' && script.indexOf('/') != -1) ||
671 (typeof script === 'string' && path.extname(script) !== ''))
672 return cb(null);
673
674 if (script !== 'all') {
675 that.Client.getProcessIdByName(script, function(err, ids) {
676 if (err && cb) return cb(err);
677 if (ids.length > 0) {
678 that._operate('restartProcessId', script, opts, function(err, list) {
679 if (err) return cb(err);
680 Common.printOut(conf.PREFIX_MSG + 'Process successfully started');
681 return cb(true, list);
682 });
683 }
684 else return cb(null);
685 });
686 }
687 else {
688 that._operate('restartProcessId', 'all', function(err, list) {
689 if (err) return cb(err);
690 Common.printOut(conf.PREFIX_MSG + 'Process successfully started');
691 return cb(true, list);
692 });
693 }
694 }
695
696 function restartExistingProcessId(cb) {
697 if (isNaN(script)) return cb(null);

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…