Wait for database connection established before continuing startup.

refs #315
This commit is contained in:
softsimon 2021-01-30 21:09:30 +07:00
parent 54a276439d
commit 21d32dec41
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7

View File

@ -61,7 +61,7 @@ class Server {
} }
} }
startServer(worker = false) { async startServer(worker = false) {
logger.debug(`Starting Mempool Server${worker ? ' (worker)' : ''}... (${backendInfo.getShortCommitHash()})`); logger.debug(`Starting Mempool Server${worker ? ' (worker)' : ''}... (${backendInfo.getShortCommitHash()})`);
this.app this.app
@ -78,7 +78,7 @@ class Server {
diskCache.loadMempoolCache(); diskCache.loadMempoolCache();
if (config.DATABASE.ENABLED) { if (config.DATABASE.ENABLED) {
checkDbConnection(); await checkDbConnection();
} }
if (config.STATISTICS.ENABLED && config.DATABASE.ENABLED) { if (config.STATISTICS.ENABLED && config.DATABASE.ENABLED) {