fix connection error for case database not running

This commit is contained in:
Ulf Gebhardt 2021-09-24 14:42:07 +02:00
parent 8326eaac95
commit 66324fe1ca
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD

View File

@ -26,8 +26,11 @@ const DB_VERSION = '0001-init_db'
async function main() {
// open mysql connection
const con = await connection()
if (!con.isConnected) {
let con = null
try {
con = await connection()
} catch (error) {}
if (!con || !con.isConnected) {
throw new Error(`Couldn't open connection to database`)
}