mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
rebase interactor
This commit is contained in:
parent
4b92b3d682
commit
9e48f18c35
@ -49,19 +49,31 @@ InteractorDaemonizer.ping = function(cb) {
|
||||
};
|
||||
|
||||
InteractorDaemonizer.killDaemon = function(cb) {
|
||||
InteractorDaemonizer.launchRPC(function(err, data) {
|
||||
if (err) {
|
||||
setTimeout(function() {
|
||||
InteractorDaemonizer.disconnectRPC(cb);
|
||||
}, 100);
|
||||
return false;
|
||||
debug('Killing interactor #1 ping');
|
||||
InteractorDaemonizer.ping(function(online) {
|
||||
debug('Interactor online', online);
|
||||
|
||||
if (!online) {
|
||||
if (!cb) Common.printError('Interactor not launched');
|
||||
return cb ? cb({msg:'Interactor not launched'}) : Common.exitCli(cst.SUCCESS_EXIT);
|
||||
}
|
||||
InteractorDaemonizer.rpc.kill(function(err) {
|
||||
if (err) Common.printError(err);
|
||||
setTimeout(function() {
|
||||
InteractorDaemonizer.disconnectRPC(cb);
|
||||
}, 100);
|
||||
|
||||
InteractorDaemonizer.launchRPC(function(err, data) {
|
||||
if (err) {
|
||||
setTimeout(function() {
|
||||
InteractorDaemonizer.disconnectRPC(cb);
|
||||
}, 100);
|
||||
return false;
|
||||
}
|
||||
InteractorDaemonizer.rpc.kill(function(err) {
|
||||
if (err) Common.printError(err);
|
||||
setTimeout(function() {
|
||||
InteractorDaemonizer.disconnectRPC(cb);
|
||||
}, 100);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user