a tool for shared writing and social publishing

don't keep long-running db connection

+3 -3
+3 -3
appview/index.ts
··· 32 32 const QUOTE_PARAM = "/l-quote/"; 33 33 async function main() { 34 34 let startCursor; 35 - let client = new Client({ connectionString: process.env.DB_URL }); 36 - let db = drizzle(client); 37 35 try { 38 36 let file = (await readFile(cursorFile)).toString(); 39 37 console.log("START CURSOR: " + file); ··· 95 93 96 94 if (error && error.code === "23503") { 97 95 console.log("creating identity"); 96 + let client = new Client({ connectionString: process.env.DB_URL }); 97 + let db = drizzle(client); 98 98 await createIdentity(db, { atp_did: evt.did }); 99 + client.end(); 99 100 await supabase.from("publications").upsert({ 100 101 uri: evt.uri.toString(), 101 102 identity_did: evt.did, ··· 283 284 if (cleaningUp) return; 284 285 cleaningUp = true; 285 286 console.log("shutting down firehose..."); 286 - client.end(); 287 287 await firehose.destroy(); 288 288 await runner.destroy(); 289 289 process.exit();