From 1a04b088fbaf2ab2fec93d7ab5148380413987ef Mon Sep 17 00:00:00 2001 From: softsimon Date: Wed, 20 Jan 2021 01:34:21 +0700 Subject: [PATCH] Fix: Load mempool cache before checking DB connectivity. --- backend/src/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/index.ts b/backend/src/index.ts index d9e8722d1..98bbe4cd1 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -61,6 +61,8 @@ class Server { } startServer(worker = false) { + logger.debug(`Starting Mempool Server${worker ? ' (worker)' : ''}... (${backendInfo.getShortCommitHash()})`); + this.app .use((req: Request, res: Response, next: NextFunction) => { res.setHeader('Access-Control-Allow-Origin', '*'); @@ -72,6 +74,8 @@ class Server { this.server = http.createServer(this.app); this.wss = new WebSocket.Server({ server: this.server }); + diskCache.loadMempoolCache(); + if (config.DATABASE.ENABLED) { checkDbConnection(); } @@ -85,7 +89,6 @@ class Server { this.runMainUpdateLoop(); fiatConversion.startService(); - diskCache.loadMempoolCache(); if (config.BISQ_BLOCKS.ENABLED) { bisq.startBisqService(); @@ -101,7 +104,7 @@ class Server { if (worker) { logger.info(`Mempool Server worker #${process.pid} started`); } else { - logger.notice(`Mempool Server is running on port ${config.MEMPOOL.HTTP_PORT} (${backendInfo.getShortCommitHash()})`); + logger.notice(`Mempool Server is running on port ${config.MEMPOOL.HTTP_PORT}`); } }); }