tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
291
fork
atom
a tool for shared writing and social publishing
291
fork
atom
overview
issues
28
pulls
pipelines
also take out a lock on the clientGroupID
awarm.space
6 months ago
65a184c6
493f7a9d
+6
1 changed file
expand all
collapse all
unified
split
app
api
rpc
[command]
push.ts
+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
87
+
const clientGroupHash = pushRequest.clientGroupID
88
88
+
.split("")
89
89
+
.reduce((acc, char) => {
90
90
+
return ((acc << 5) - acc + char.charCodeAt(0)) | 0;
91
91
+
}, 0);
87
92
await tx.execute(sql`SELECT pg_advisory_xact_lock(${tokenHash})`);
93
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);