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
don't keep long-running db connection
awarm.space
6 months ago
f455f218
88f56a58
+3
-3
1 changed file
expand all
collapse all
unified
split
appview
index.ts
+3
-3
appview/index.ts
···
32
32
const QUOTE_PARAM = "/l-quote/";
33
33
async function main() {
34
34
let startCursor;
35
35
-
let client = new Client({ connectionString: process.env.DB_URL });
36
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
96
+
let client = new Client({ connectionString: process.env.DB_URL });
97
97
+
let db = drizzle(client);
98
98
await createIdentity(db, { atp_did: evt.did });
99
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
286
-
client.end();
287
287
await firehose.destroy();
288
288
await runner.destroy();
289
289
process.exit();