diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-11-17 15:46:59 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-11-17 15:59:06 +0100 |
commit | b90d1c0318e392fa5324ea31abe3b86919cbf699 (patch) | |
tree | aca593f6bcdc70893d2a0377d8f45a1a09ce052c /src | |
parent | c8576b433d8442694e0427301cf061aade0a6f8e (diff) | |
download | wallet-core-b90d1c0318e392fa5324ea31abe3b86919cbf699.tar.xz |
truncate back-off
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet.ts b/src/wallet.ts index fc9fd823b..8f6346c77 100644 --- a/src/wallet.ts +++ b/src/wallet.ts @@ -731,7 +731,7 @@ export class Wallet { retryDelayMs = 200): Promise<void> { if (this.processPreCoinConcurrent >= 4 || this.processPreCoinThrottle[preCoin.exchangeBaseUrl]) { console.log("delaying processPreCoin"); - setTimeout(() => this.processPreCoin(preCoin, retryDelayMs * 2), + setTimeout(() => this.processPreCoin(preCoin, Math.min(retryDelayMs * 2, 5 * 60 * 1000)), retryDelayMs); return; } @@ -791,7 +791,7 @@ export class Wallet { retryDelayMs, "ms", e); // exponential backoff truncated at one minute - let nextRetryDelayMs = Math.min(retryDelayMs * 2, 1000 * 60); + let nextRetryDelayMs = Math.min(retryDelayMs * 2, 5 * 60 * 1000); setTimeout(() => this.processPreCoin(preCoin, nextRetryDelayMs), retryDelayMs); this.processPreCoinThrottle[preCoin.exchangeBaseUrl] = (this.processPreCoinThrottle[preCoin.exchangeBaseUrl] || 0) + 1; |