mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
finish proper handling of restart for process group
This commit is contained in:
parent
21c701dc6d
commit
18c8fc8563
3 changed files with 12 additions and 10 deletions
|
@ -13,6 +13,7 @@ $(function() {
|
|||
|
||||
var serverState = arg.home.state;
|
||||
var serverCircles = $('#ds-status .circle, #ac-status .circle');
|
||||
|
||||
switch (serverState) {
|
||||
case HFProcess.ProcessStates.STOPPED:
|
||||
serverCircles.attr('class', 'circle stopped');
|
||||
|
|
|
@ -149,9 +149,7 @@ app.on('ready', function() {
|
|||
sendProcessUpdate();
|
||||
});
|
||||
ipcMain.on('restart-server', function(event, arg) {
|
||||
homeServer.stop();
|
||||
sendProcessUpdate();
|
||||
homeServer.start();
|
||||
homeServer.restart();
|
||||
sendProcessUpdate();
|
||||
});
|
||||
ipcMain.on('stop-server', function(event, arg) {
|
||||
|
|
|
@ -59,14 +59,17 @@ ProcessGroup.prototype = extend(ProcessGroup.prototype, {
|
|||
this.state = ProcessGroupStates.STOPPING;
|
||||
},
|
||||
restart: function() {
|
||||
// set our restart flag so the group will restart once stopped
|
||||
this.restarting = true;
|
||||
if (this.state == ProcessGroupStates.STOPPED) {
|
||||
// start the group, we were already stopped
|
||||
console.log("STARTING THE GROUP, ALREADY STOPPED");
|
||||
this.start();
|
||||
} else {
|
||||
// set our restart flag so the group will restart once stopped
|
||||
this.restarting = true;
|
||||
|
||||
// call stop, that will put them in the stopping state
|
||||
this.stop();
|
||||
|
||||
// update our state
|
||||
this.state = ProcessGroupStates.STOPPING;
|
||||
// call stop, that will put them in the stopping state
|
||||
this.stop();
|
||||
}
|
||||
},
|
||||
|
||||
// Event handlers
|
||||
|
|
Loading…
Reference in a new issue