mirror of
https://github.com/mempool/mempool.git
synced 2025-04-23 06:55:09 +02:00
reduce mempool poll rate while indexing
This commit is contained in:
parent
bafc0bd9cf
commit
6b7d8d95f7
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user