mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix connection error for case database not running
This commit is contained in:
parent
8326eaac95
commit
66324fe1ca
@ -26,8 +26,11 @@ const DB_VERSION = '0001-init_db'
|
|||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
// open mysql connection
|
// open mysql connection
|
||||||
const con = await connection()
|
let con = null
|
||||||
if (!con.isConnected) {
|
try {
|
||||||
|
con = await connection()
|
||||||
|
} catch (error) {}
|
||||||
|
if (!con || !con.isConnected) {
|
||||||
throw new Error(`Couldn't open connection to database`)
|
throw new Error(`Couldn't open connection to database`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user