Add error message to log if database cannot be reached

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-02-04 11:46:44 +01:00
parent 46f822453d
commit cc0c469c2d
No known key found for this signature in database
GPG key ID: B97799103358209B
2 changed files with 3 additions and 2 deletions

4
app.js
View file

@ -291,9 +291,9 @@ function syncAndListen () {
process.exit(1)
}
})
}).catch(() => {
}).catch((dbError) => {
if (currentDBTry < maxDBTries) {
logger.warn(`Database cannot be reached. Try ${currentDBTry} of ${maxDBTries}.`)
logger.warn(`Database cannot be reached. Try ${currentDBTry} of ${maxDBTries}. (${dbError})`)
currentDBTry++
setTimeout(function () {
syncAndListen()