fix(storage): make sure the storage initialization crashes when db connection can't be established

This commit is contained in:
Joakim Carlstein 2024-02-05 14:41:03 +01:00 committed by Joakim Carlstein
parent f6761fe434
commit f8a5cc728d
3 changed files with 15 additions and 7 deletions

View file

@ -171,6 +171,8 @@ export const createMysqlStorage = ({ table = defaultTable, connection }: MysqlSt
async initializeStorage() {
const pool = getPool(connection);
await pool.query('SELECT 1');
try {
await initializeTable(pool, table);
} catch (error) {