Skip to content

Commit

Permalink
fix: Make sure Server exec closes on bad exit
Browse files Browse the repository at this point in the history
  • Loading branch information
colin969 committed Oct 19, 2023
1 parent e552b33 commit 22ae789
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/back/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -995,8 +995,11 @@ async function initialize() {
}
// Run processes
if (state.serviceInfo.server.length > 0) {
const chosenServer = state.serviceInfo.server.find(i => i.name === state.preferences.server);
runService(state, 'server', 'Server', state.config.flashpointPath, {}, chosenServer || state.serviceInfo.server[0]);
let chosenServer = state.serviceInfo.server.find(i => i.name === state.preferences.server);
if (!chosenServer) {
chosenServer = state.serviceInfo.server[0];
}
runService(state, 'server', 'Server', state.config.flashpointPath, { detached: !chosenServer.kill, noshell: !!chosenServer.kill }, chosenServer);
}
// Start daemons
for (let i = 0; i < state.serviceInfo.daemon.length; i++) {
Expand Down

0 comments on commit 22ae789

Please sign in to comment.