Set backend to out of sync after connection retry interval has exceeded.

This commit is contained in:
softsimon
2021-01-20 17:16:43 +07:00
parent a158794e2c
commit 9900f4da80
2 changed files with 8 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ import donations from './api/donations';
import logger from './logger';
import backendInfo from './api/backend-info';
import loadingIndicators from './api/loading-indicators';
import mempool from './api/mempool';
class Server {
private wss: WebSocket.Server | undefined;
@@ -120,6 +121,7 @@ class Server {
const loggerMsg = `runMainLoop error: ${(e.message || e)}. Retrying in ${this.currentBackendRetryInterval} sec.`;
if (this.currentBackendRetryInterval > 5) {
logger.warn(loggerMsg);
mempool.setOutOfSync();
} else {
logger.debug(loggerMsg);
}