handle failed restart command
This commit is contained in:
parent
13d526163f
commit
39b89b40ba
|
@ -84,6 +84,9 @@ const runRestarts = async (status: Awaited<ReturnType<typeof periodicCheck>>) =>
|
||||||
const result = exec(RESTART_COMMAND_BOT!);
|
const result = exec(RESTART_COMMAND_BOT!);
|
||||||
result.stdout?.on('data', data => console.log(data));
|
result.stdout?.on('data', data => console.log(data));
|
||||||
result.stderr?.on('data', data => console.log(data));
|
result.stderr?.on('data', data => console.log(data));
|
||||||
|
result.on('exit', code => {
|
||||||
|
if (code != 0) restarting.bot = false; // Assume restart command has failed
|
||||||
|
});
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
@ -96,6 +99,9 @@ const runRestarts = async (status: Awaited<ReturnType<typeof periodicCheck>>) =>
|
||||||
const result = exec(RESTART_COMMAND_BRIDGE!);
|
const result = exec(RESTART_COMMAND_BRIDGE!);
|
||||||
result.stdout?.on('data', data => console.log(data));
|
result.stdout?.on('data', data => console.log(data));
|
||||||
result.stderr?.on('data', data => console.log(data));
|
result.stderr?.on('data', data => console.log(data));
|
||||||
|
result.on('exit', code => {
|
||||||
|
if (code != 0) restarting.bridge = false;
|
||||||
|
});
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue