mirror of
https://github.com/mempool/mempool.git
synced 2025-03-03 17:47:01 +01:00
Reducing retry time to max 60 seconds
This commit is contained in:
parent
49f70ca28a
commit
0abe62128e
1 changed files with 2 additions and 2 deletions
|
@ -122,10 +122,10 @@ class Server {
|
||||||
setTimeout(this.runMempoolIntervalFunctions.bind(this), config.ELECTRS_POLL_RATE_MS);
|
setTimeout(this.runMempoolIntervalFunctions.bind(this), config.ELECTRS_POLL_RATE_MS);
|
||||||
this.retryOnElectrsErrorAfterSeconds = 5;
|
this.retryOnElectrsErrorAfterSeconds = 5;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.retryOnElectrsErrorAfterSeconds *= 2;
|
|
||||||
this.retryOnElectrsErrorAfterSeconds = Math.min(this.retryOnElectrsErrorAfterSeconds, 3600);
|
|
||||||
logger.warn(`runMempoolIntervalFunctions error: ${(e.message || e)}. Retrying in ${this.retryOnElectrsErrorAfterSeconds} sec.`);
|
logger.warn(`runMempoolIntervalFunctions error: ${(e.message || e)}. Retrying in ${this.retryOnElectrsErrorAfterSeconds} sec.`);
|
||||||
setTimeout(this.runMempoolIntervalFunctions.bind(this), 1000 * this.retryOnElectrsErrorAfterSeconds);
|
setTimeout(this.runMempoolIntervalFunctions.bind(this), 1000 * this.retryOnElectrsErrorAfterSeconds);
|
||||||
|
this.retryOnElectrsErrorAfterSeconds *= 2;
|
||||||
|
this.retryOnElectrsErrorAfterSeconds = Math.min(this.retryOnElectrsErrorAfterSeconds, 60);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue