mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 13:33:38 +02:00
immediately shutdown if home server is stopped
This commit is contained in:
parent
21074fe4e4
commit
7186a538b2
1 changed files with 15 additions and 8 deletions
|
@ -87,15 +87,22 @@ function shutdown() {
|
|||
homeServer.stop();
|
||||
}
|
||||
|
||||
var timeoutID = setTimeout(app.quit, 5000);
|
||||
homeServer.on('state-update', function(processGroup) {
|
||||
if (processGroup.state == ProcessGroupStates.STOPPED) {
|
||||
clearTimeout(timeoutID);
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
|
||||
updateTrayMenu(null);
|
||||
|
||||
if (homeServer.state == ProcessGroupStates.STOPPED) {
|
||||
// if the home server is already down, take down the server console now
|
||||
app.quit();
|
||||
} else {
|
||||
// if the home server is still running, wait until we get a state change or timeout
|
||||
// before quitting the app
|
||||
var timeoutID = setTimeout(app.quit, 5000);
|
||||
homeServer.on('state-update', function(processGroup) {
|
||||
if (processGroup.state == ProcessGroupStates.STOPPED) {
|
||||
clearTimeout(timeoutID);
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue