reduce mempool poll rate while indexing

This commit is contained in:
Mononaut committed 2023-07-31 18:13:16 +09:00
1 parent 3dbafc271b
commit 34e5da56e3
1 file changed
+2 -1
+2 -1
View File
@@ -195,7 +195,8 @@ class Server {
// rerun immediately if we skipped the mempool update, otherwise wait POLL_RATE_MS
const elapsed = Date.now() - start;
const remainingTime = Math.max(0, config.MEMPOOL.POLL_RATE_MS - elapsed)
const pollRate = config.MEMPOOL.POLL_RATE_MS * (indexer.indexerRunning ? 10 : 1);
const remainingTime = Math.max(0, pollRate - elapsed);
setTimeout(this.runMainUpdateLoop.bind(this), numHandledBlocks > 0 ? 0 : remainingTime);
this.backendRetryCount = 0;
} catch (e: any) {