MCPcopy Index your code
hub / github.com/Unitech/pm2 / update

Method update

modules/pm2-io-agent/src/InteractorClient.js:324–343  ·  view source on GitHub ↗

* Restart the Interactor Daemon * @param {Object} conf global constants * @param {Function} cb invoked with

(conf, cb)

Source from the content-addressed store, hash-verified

322 * @param {Function} cb invoked with <err, msg>
323 */
324 static update (conf, cb) {
325 this.ping(conf, (err, online) => {
326 if (err || !online) {
327 return cb ? cb(new Error('Interactor not launched')) : printError('Interactor not launched')
328 }
329 this.launchRPC(conf, _ => {
330 this.rpc.kill((err) => {
331 if (err) {
332 return cb ? cb(err) : printError(err)
333 }
334 printOut('Interactor successfully killed')
335 setTimeout(_ => {
336 this.launchAndInteract(conf, {}, _ => {
337 return cb(null, { msg: 'Daemon launched' })
338 })
339 }, 500)
340 })
341 })
342 })
343 }
344
345 /**
346 * Retrieve Interactor configuration from env, params and filesystem.

Callers

nothing calls this directly

Calls 7

pingMethod · 0.95
launchRPCMethod · 0.95
launchAndInteractMethod · 0.95
cbFunction · 0.85
printErrorFunction · 0.85
printOutFunction · 0.85
killMethod · 0.65

Tested by

no test coverage detected