fix: gate gateway restarts and discord abort reconnects
This commit is contained in:
@@ -45,6 +45,10 @@ async function main() {
|
||||
{ startGatewayServer },
|
||||
{ setGatewayWsLogStyle },
|
||||
{ setVerbose },
|
||||
{
|
||||
consumeGatewaySigusr1RestartAuthorization,
|
||||
isGatewaySigusr1RestartExternallyAllowed,
|
||||
},
|
||||
{ defaultRuntime },
|
||||
{ enableConsoleCapture, setConsoleTimestampPrefix },
|
||||
] = await Promise.all([
|
||||
@@ -52,6 +56,7 @@ async function main() {
|
||||
import("../gateway/server.js"),
|
||||
import("../gateway/ws-logging.js"),
|
||||
import("../globals.js"),
|
||||
import("../infra/restart.js"),
|
||||
import("../runtime.js"),
|
||||
import("../logging.js"),
|
||||
]);
|
||||
@@ -156,6 +161,13 @@ async function main() {
|
||||
};
|
||||
const onSigusr1 = () => {
|
||||
defaultRuntime.log("gateway: signal SIGUSR1 received");
|
||||
const authorized = consumeGatewaySigusr1RestartAuthorization();
|
||||
if (!authorized && !isGatewaySigusr1RestartExternallyAllowed()) {
|
||||
defaultRuntime.log(
|
||||
"gateway: SIGUSR1 restart ignored (not authorized; enable commands.restart or use gateway tool).",
|
||||
);
|
||||
return;
|
||||
}
|
||||
request("restart", "SIGUSR1");
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user