fix: keep node presence fresh

This commit is contained in:
Peter Steinberger
2026-01-04 14:30:43 +01:00
parent 672700f2b3
commit 529cf91ac3
9 changed files with 6377 additions and 240 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -946,15 +946,18 @@ export async function startGatewayServer(
nodePresenceTimers.delete(nodeId);
};
const beaconNodePresence = (node: {
nodeId: string;
displayName?: string;
remoteIp?: string;
version?: string;
platform?: string;
deviceFamily?: string;
modelIdentifier?: string;
}, reason: string) => {
const beaconNodePresence = (
node: {
nodeId: string;
displayName?: string;
remoteIp?: string;
version?: string;
platform?: string;
deviceFamily?: string;
modelIdentifier?: string;
},
reason: string,
) => {
const host = node.displayName?.trim() || node.nodeId;
const rawIp = node.remoteIp?.trim();
const ip = rawIp && !isLoopbackAddress(rawIp) ? rawIp : undefined;
@@ -1826,6 +1829,10 @@ export async function startGatewayServer(
await stopGmailWatcher();
cron.stop();
heartbeatRunner.stop();
for (const timer of nodePresenceTimers.values()) {
clearInterval(timer);
}
nodePresenceTimers.clear();
broadcast("shutdown", {
reason,
restartExpectedMs,