From 21d32dec41cc2a5dddf213f25092f59577f7d250 Mon Sep 17 00:00:00 2001 From: softsimon Date: Sat, 30 Jan 2021 21:09:30 +0700 Subject: [PATCH] Wait for database connection established before continuing startup. refs #315 --- backend/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index c4b7045ee..206c8ef8e 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -61,7 +61,7 @@ class Server { } } - startServer(worker = false) { + async startServer(worker = false) { logger.debug(`Starting Mempool Server${worker ? ' (worker)' : ''}... (${backendInfo.getShortCommitHash()})`); this.app @@ -78,7 +78,7 @@ class Server { diskCache.loadMempoolCache(); if (config.DATABASE.ENABLED) { - checkDbConnection(); + await checkDbConnection(); } if (config.STATISTICS.ENABLED && config.DATABASE.ENABLED) {