fix: gate gateway restarts and discord abort reconnects
This commit is contained in:
@@ -3,6 +3,10 @@ import type { loadConfig } from "../config/config.js";
|
||||
import { startGmailWatcher, stopGmailWatcher } from "../hooks/gmail-watcher.js";
|
||||
import { startHeartbeatRunner } from "../infra/heartbeat-runner.js";
|
||||
import { resetDirectoryCache } from "../infra/outbound/target-resolver.js";
|
||||
import {
|
||||
authorizeGatewaySigusr1Restart,
|
||||
setGatewaySigusr1RestartPolicy,
|
||||
} from "../infra/restart.js";
|
||||
import { setCommandLaneConcurrency } from "../process/command-queue.js";
|
||||
import { isTruthyEnvValue } from "../infra/env.js";
|
||||
import type { ChannelKind, GatewayReloadPlan } from "./config-reload.js";
|
||||
@@ -38,6 +42,7 @@ export function createGatewayReloadHandlers(params: {
|
||||
plan: GatewayReloadPlan,
|
||||
nextConfig: ReturnType<typeof loadConfig>,
|
||||
) => {
|
||||
setGatewaySigusr1RestartPolicy({ allowExternal: nextConfig.commands?.restart === true });
|
||||
const state = params.getState();
|
||||
const nextState = { ...state };
|
||||
|
||||
@@ -139,8 +144,9 @@ export function createGatewayReloadHandlers(params: {
|
||||
|
||||
const requestGatewayRestart = (
|
||||
plan: GatewayReloadPlan,
|
||||
_nextConfig: ReturnType<typeof loadConfig>,
|
||||
nextConfig: ReturnType<typeof loadConfig>,
|
||||
) => {
|
||||
setGatewaySigusr1RestartPolicy({ allowExternal: nextConfig.commands?.restart === true });
|
||||
const reasons = plan.restartReasons.length
|
||||
? plan.restartReasons.join(", ")
|
||||
: plan.changedPaths.join(", ");
|
||||
@@ -149,6 +155,7 @@ export function createGatewayReloadHandlers(params: {
|
||||
params.logReload.warn("no SIGUSR1 listener found; restart skipped");
|
||||
return;
|
||||
}
|
||||
authorizeGatewaySigusr1Restart();
|
||||
process.emit("SIGUSR1");
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user