a tool for shared writing and social publishing

just lock on token

It seems better? purely anecdotally from looking at the docs

+1 -10
+1 -10
app/api/rpc/[command]/push.ts
··· 82 82 const tokenHash = token.id.split("").reduce((acc, char) => { 83 83 return ((acc << 5) - acc + char.charCodeAt(0)) | 0; 84 84 }, 0); 85 - const clientGroupHash = pushRequest.clientGroupID 86 - .split("") 87 - .reduce((acc, char) => { 88 - return ((acc << 5) - acc + char.charCodeAt(0)) | 0; 89 - }, 0); 90 85 91 - await tx.execute(sql` 92 - SELECT 93 - pg_advisory_xact_lock(${tokenHash}), 94 - pg_advisory_xact_lock(${clientGroupHash}) 95 - `); 86 + await tx.execute(sql`SELECT pg_advisory_xact_lock(${tokenHash})`); 96 87 97 88 let clientGroupStart = performance.now(); 98 89 let clientGroup = await getClientGroup(tx, pushRequest.clientGroupID);