a tool for shared writing and social publishing

also take out a lock on the clientGroupID

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