Skip to content

Commit d15b9fc

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 0504578 commit d15b9fc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
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: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ const logger = root_logger.child({ source: 'migrate' });
66
logger.info('Starting migrations...');
77
migrate()
88
.then(() => {
9-
logger.info('Migrations complete.');
10-
process.exit();
9+
process.stdout.write('Migrations complete.\n');
1110
})
1211
.catch((reason: unknown) => {
1312
logger.error('Migrations failed!');

0 commit comments

Comments
 (0)