Fix ping function

This commit is contained in:
Owen
2026-07-01 15:47:24 -04:00
parent ba33cb9895
commit bcc128aeb6
4 changed files with 6 additions and 9 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import { Newt } from "@server/db";
import { eq } from "drizzle-orm";
import logger from "@server/logger";
import { sendNewtSyncMessage } from "./sync";
import { recordPing } from "./pingAccumulator";
import { recordSitePing } from "./pingAccumulator";
/**
* Handles ping messages from newt clients.
@@ -35,7 +35,7 @@ export const handleNewtPingMessage: MessageHandler = async (context) => {
// batched UPDATE instead of one query per ping. This prevents
// connection pool exhaustion under load, especially with
// cross-region latency to the database.
recordPing(newt.siteId);
recordSitePing(newt.siteId);
// Check config version and sync if stale.
const configVersion = await getClientConfigVersion(newt.newtId);
-3
View File
@@ -57,9 +57,6 @@ export function recordSitePing(siteId: number): void {
pendingSitePings.set(siteId, now);
}
/** @deprecated Use `recordSitePing` instead. Alias kept for existing call-sites. */
export const recordPing = recordSitePing;
/**
* Record a ping for an OLM client. Batches the `clients` table update
* (`online`, `lastPing`, `archived`) and, when `olmArchived` is true,