fix(routines): address Greptile review findings

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta
2026-04-02 12:09:02 -05:00
parent 38a0cd275e
commit fd6cfc7149
5 changed files with 77 additions and 21 deletions
+6 -2
View File
@@ -197,10 +197,14 @@ async function openConfiguredDb(configPath: string): Promise<{
await ensurePostgresDatabase(adminConnectionString, "paperclip");
const connectionString = `postgres://paperclip:paperclip@127.0.0.1:${embeddedHandle.port}/paperclip`;
await applyPendingMigrations(connectionString);
const db = createDb(connectionString) as ClosableDb;
return {
db: createDb(connectionString) as ClosableDb,
db,
stop: async () => {
await closeDb(createDb(connectionString) as ClosableDb);
await closeDb(db);
if (embeddedHandle?.startedByThisProcess) {
await embeddedHandle.stop().catch(() => undefined);
}
},
};
}