a tool for shared writing and social publishing

remove locking mechanism

-10
-10
app/api/rpc/[command]/push.ts
··· 7 7 import type { Env } from "./route"; 8 8 import { cachedServerMutationContext } from "src/replicache/cachedServerMutationContext"; 9 9 import { drizzle } from "drizzle-orm/node-postgres"; 10 - import { Lock } from "src/utils/lock"; 11 10 import { pool } from "supabase/pool"; 12 11 13 12 const mutationV0Schema = z.object({ ··· 45 44 46 45 type PushRequestZ = z.infer<typeof pushRequestSchema>; 47 46 48 - let locks = new Map<string, Lock>(); 49 - 50 47 export const push = makeRoute({ 51 48 route: "push", 52 49 input: z.object({ ··· 78 75 start = performance.now(); 79 76 const db = drizzle(client); 80 77 let channel = supabase.channel(`rootEntity:${rootEntity}`); 81 - let lock = locks.get(token.id); 82 - if (!lock) { 83 - lock = new Lock(); 84 - locks.set(token.id, lock); 85 - } 86 - let release = await lock.lock(); 87 78 timeWaitingForLock = performance.now() - start; 88 79 start = performance.now(); 89 80 try { ··· 210 201 `); 211 202 212 203 client.release(); 213 - release(); 214 204 await supabase.removeChannel(channel); 215 205 return { result: undefined } as const; 216 206 }