From 2a0f45ef0e03d83075a2454d9f23dc3d205c7699 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Sun, 31 Aug 2025 19:34:17 +0900 Subject: [PATCH] just lock on token It seems better? purely anecdotally from looking at the docs --- app/api/rpc/[command]/push.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/app/api/rpc/[command]/push.ts b/app/api/rpc/[command]/push.ts index b478c012..07b745c5 100644 --- a/app/api/rpc/[command]/push.ts +++ b/app/api/rpc/[command]/push.ts @@ -82,17 +82,8 @@ export const push = makeRoute({ const tokenHash = token.id.split("").reduce((acc, char) => { return ((acc << 5) - acc + char.charCodeAt(0)) | 0; }, 0); - const clientGroupHash = pushRequest.clientGroupID - .split("") - .reduce((acc, char) => { - return ((acc << 5) - acc + char.charCodeAt(0)) | 0; - }, 0); - - await tx.execute(sql` - SELECT - pg_advisory_xact_lock(${tokenHash}), - pg_advisory_xact_lock(${clientGroupHash}) - `); + + await tx.execute(sql`SELECT pg_advisory_xact_lock(${tokenHash})`); let clientGroupStart = performance.now(); let clientGroup = await getClientGroup(tx, pushRequest.clientGroupID); -- 2.51.2