* Restart the Interactor Daemon * @param {Object} conf global constants * @param {Function} cb invoked with
(conf, cb)
| 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. |
nothing calls this directly
no test coverage detected