refactor(config): centralize runtime config state

This commit is contained in:
Peter Steinberger
2026-03-30 00:13:59 +01:00
parent b888741462
commit 89a4f2a34e
13 changed files with 366 additions and 256 deletions

View File

@@ -1,7 +1,7 @@
import { spawnSync } from "node:child_process";
import os from "node:os";
import path from "node:path";
import { loadConfig } from "../config/config.js";
import { getRuntimeConfig } from "../config/config.js";
import {
resolveGatewayLaunchAgentLabel,
resolveGatewaySystemdServiceName,
@@ -477,7 +477,7 @@ export function scheduleGatewaySigusr1Restart(opts?: {
emitGatewayRestart();
return;
}
const cfg = loadConfig();
const cfg = getRuntimeConfig();
deferGatewayRestartUntilIdle({
getPendingCount: pendingCheck,
maxWaitMs: cfg.gateway?.reload?.deferralTimeoutMs,