From bc94960cb4ae4e9852ed0c462ddadf39e5a386e5 Mon Sep 17 00:00:00 2001 From: Vasyl Ivanchuk Date: Fri, 12 Apr 2024 18:36:14 +0300 Subject: [PATCH] fix: increase default timeout settings (#228) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # What ❔ Increase default timeout settings. ## Why ❔ To make sure explorer can handle large transactions. ## Checklist - [X] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [X] Tests for the changes have been added / updated. --- packages/data-fetcher/.env.example | 6 +++--- packages/data-fetcher/src/config.spec.ts | 6 +++--- packages/data-fetcher/src/config.ts | 6 +++--- packages/worker/.env.example | 2 +- packages/worker/src/config.spec.ts | 2 +- packages/worker/src/config.ts | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/data-fetcher/.env.example b/packages/data-fetcher/.env.example index 5d001d848f..786b5051f5 100644 --- a/packages/data-fetcher/.env.example +++ b/packages/data-fetcher/.env.example @@ -6,10 +6,10 @@ GRACEFUL_SHUTDOWN_TIMEOUT_MS=0 BLOCKCHAIN_RPC_URL=http://localhost:3050 RPC_CALLS_DEFAULT_RETRY_TIMEOUT=30000 -RPC_CALLS_QUICK_RETRY_TIMEOUT=500 -RPC_CALLS_RETRIES_MAX_TOTAL_TIMEOUT=90000 +RPC_CALLS_QUICK_RETRY_TIMEOUT=5000 +RPC_CALLS_RETRIES_MAX_TOTAL_TIMEOUT=120000 -RPC_CALLS_CONNECTION_TIMEOUT=20000 +RPC_CALLS_CONNECTION_TIMEOUT=60000 RPC_CALLS_CONNECTION_QUICK_TIMEOUT=10000 MAX_BLOCKS_BATCH_SIZE=20 \ No newline at end of file diff --git a/packages/data-fetcher/src/config.spec.ts b/packages/data-fetcher/src/config.spec.ts index a26d65a490..bbeb4995b0 100644 --- a/packages/data-fetcher/src/config.spec.ts +++ b/packages/data-fetcher/src/config.spec.ts @@ -17,9 +17,9 @@ describe("config", () => { blockchain: { rpcUrl: "http://localhost:3050", rpcCallDefaultRetryTimeout: 30000, - rpcCallQuickRetryTimeout: 500, - rpcCallRetriesMaxTotalTimeout: 90000, - rpcCallConnectionTimeout: 20000, + rpcCallQuickRetryTimeout: 5000, + rpcCallRetriesMaxTotalTimeout: 120000, + rpcCallConnectionTimeout: 60000, rpcCallConnectionQuickTimeout: 10000, wsMaxConnections: 5, useWebSocketsForTransactions: false, diff --git a/packages/data-fetcher/src/config.ts b/packages/data-fetcher/src/config.ts index 3a80a0a938..7c4819da0c 100644 --- a/packages/data-fetcher/src/config.ts +++ b/packages/data-fetcher/src/config.ts @@ -22,10 +22,10 @@ export default () => { rpcUrl: BLOCKCHAIN_RPC_URL || "http://localhost:3050", rpcCallDefaultRetryTimeout: parseInt(RPC_CALLS_DEFAULT_RETRY_TIMEOUT, 10) || 30000, - rpcCallQuickRetryTimeout: parseInt(RPC_CALLS_QUICK_RETRY_TIMEOUT, 10) || 500, - rpcCallRetriesMaxTotalTimeout: parseInt(RPC_CALLS_RETRIES_MAX_TOTAL_TIMEOUT, 10) || 90000, + rpcCallQuickRetryTimeout: parseInt(RPC_CALLS_QUICK_RETRY_TIMEOUT, 10) || 5000, + rpcCallRetriesMaxTotalTimeout: parseInt(RPC_CALLS_RETRIES_MAX_TOTAL_TIMEOUT, 10) || 120000, - rpcCallConnectionTimeout: parseInt(RPC_CALLS_CONNECTION_TIMEOUT, 10) || 20000, + rpcCallConnectionTimeout: parseInt(RPC_CALLS_CONNECTION_TIMEOUT, 10) || 60000, rpcCallConnectionQuickTimeout: parseInt(RPC_CALLS_CONNECTION_QUICK_TIMEOUT, 10) || 10000, wsMaxConnections: parseInt(WS_MAX_CONNECTIONS, 10) || 5, diff --git a/packages/worker/.env.example b/packages/worker/.env.example index d06ef87b32..7e67739bb3 100644 --- a/packages/worker/.env.example +++ b/packages/worker/.env.example @@ -10,7 +10,7 @@ DATABASE_CONNECTION_POOL_SIZE=100 BLOCKCHAIN_RPC_URL=http://localhost:3050 DATA_FETCHER_URL=http://localhost:3040 -DATA_FETCHER_REQUEST_TIMEOUT=120000 +DATA_FETCHER_REQUEST_TIMEOUT=150000 WAIT_FOR_BLOCKS_INTERVAL=1000 BLOCKS_PROCESSING_BATCH_SIZE=10 diff --git a/packages/worker/src/config.spec.ts b/packages/worker/src/config.spec.ts index 7cc332aec2..150e2167c3 100644 --- a/packages/worker/src/config.spec.ts +++ b/packages/worker/src/config.spec.ts @@ -23,7 +23,7 @@ describe("config", () => { }, dataFetcher: { url: "http://localhost:3040", - requestTimeout: 60_000, + requestTimeout: 150_000, }, blocks: { waitForBlocksInterval: 1000, diff --git a/packages/worker/src/config.ts b/packages/worker/src/config.ts index f8f82eb85e..42f4d286b7 100644 --- a/packages/worker/src/config.ts +++ b/packages/worker/src/config.ts @@ -41,7 +41,7 @@ export default () => { }, dataFetcher: { url: DATA_FETCHER_URL || "http://localhost:3040", - requestTimeout: parseInt(DATA_FETCHER_REQUEST_TIMEOUT, 10) || 60_000, + requestTimeout: parseInt(DATA_FETCHER_REQUEST_TIMEOUT, 10) || 150_000, }, blocks: { waitForBlocksInterval: parseInt(WAIT_FOR_BLOCKS_INTERVAL, 10) || 1000,