Skip to content

Commit

Permalink
fix: increase default timeout settings (#228)
Browse files Browse the repository at this point in the history
# What ❔

Increase default timeout settings.

## Why ❔

To make sure explorer can handle large transactions.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [X] Tests for the changes have been added / updated.
  • Loading branch information
vasyl-ivanchuk authored Apr 12, 2024
1 parent 6e1505e commit bc94960
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions packages/data-fetcher/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions packages/data-fetcher/src/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions packages/data-fetcher/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/src/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("config", () => {
},
dataFetcher: {
url: "http://localhost:3040",
requestTimeout: 60_000,
requestTimeout: 150_000,
},
blocks: {
waitForBlocksInterval: 1000,
Expand Down
2 changes: 1 addition & 1 deletion packages/worker/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bc94960

Please sign in to comment.