fix: keep node presence fresh

This commit is contained in:
Peter Steinberger committed 2026-01-04 14:41:52 +01:00
1 parent 672700f2b3
commit 529cf91ac3
9 files changed
+6377 -240

No files matched your search

File diff suppressed because it is too large. Load diff
+16 -9
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,