mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 01:50:39 +09:00
fix(routines): address Greptile review findings
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
38a0cd275e
commit
fd6cfc7149
5 changed files with 77 additions and 21 deletions
|
|
@ -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);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue