Skip to content

Commit ff930a0

Browse files
committed
Fix unclosed connection bug
Migrations were opening a client connection without releasing it. This means tests would hang at the very least. It is also why we were forced to manually exit the migration process.
1 parent be66ca5 commit ff930a0

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

src/database/migrate.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ export const migrate = async (): Promise<void> => {
88
{ client },
99
path.resolve(__dirname, 'migrations'),
1010
);
11+
client.release();
1112
};

src/scripts/migrate.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ process.stdout.write('Starting migrations...\n');
44
migrate()
55
.then(() => {
66
process.stdout.write('Migrations complete.\n');
7-
process.exit();
87
})
98
.catch((reason: unknown) => {
109
process.stdout.write('Migrations failed!\n');

0 commit comments

Comments
 (0)