Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1911 from LiskHQ/1906-api-request-slowdown-when-c…
Browse files Browse the repository at this point in the history
…ache-enabled

API request slowdown when cache enabled
  • Loading branch information
sameersubudhi authored Nov 2, 2023
2 parents 5cef435 + 11f8f11 commit 2a4ad06
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/antora/modules/ROOT/pages/configuration/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ Only to be used when the genesis block is large enough to be transmitted over AP
| `ENABLE_BLOCK_CACHING`
| boolean
| Boolean flag to enable block caching.
Disabled by default.
To enable it, set it to `true`.
| false
Enabled by default.
To disable it, set it to `false`.
| true

| `EXPIRY_IN_HOURS`
| number
Expand Down
2 changes: 1 addition & 1 deletion services/blockchain-connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ A list of the most commonly used environment variables is presented below:
- `LISK_APP_DATA_PATH`: Data path to connect with the Lisk SDK-based application node over IPC. Not applicable to a docker-based setup.
- `GENESIS_BLOCK_URL`: URL of the Lisk SDK-based application' genesis block. Only to be used when the genesis block is large enough to be transmitted over API calls within the timeout.
- `GEOIP_JSON`: URL of GeoIP server.
- `ENABLE_BLOCK_CACHING`: Boolean flag to enable the block caching. Disabled by default. To enable, set it to `true`.
- `ENABLE_BLOCK_CACHING`: Boolean flag to enable the block caching. Enabled by default. To disable, set it to `false`.
- `EXPIRY_IN_HOURS`: Expiry time (in hours) for block cache. By default, it is set to 12.
- `CLIENT_INSTANTIATION_MAX_WAIT_TIME`: Maximum wait time (in milliseconds) for the API client instantiation before forcefully instantiating a new client when getApiClient is invoked. By default, it is set to 100.
- `CLIENT_INSTANTIATION_RETRY_INTERVAL`: Retry interval (in milliseconds) to invoke instantiate API client when getApiClient is invoked. By default, it is set to 5.
Expand Down
4 changes: 3 additions & 1 deletion services/blockchain-connector/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ config.enableTestingMode = Boolean(
);

config.cache = {
isBlockCachingEnabled: Boolean(String(process.env.ENABLE_BLOCK_CACHING).toLowerCase() === 'true'), // Disabled by default
isBlockCachingEnabled: Boolean(
String(process.env.ENABLE_BLOCK_CACHING).toLowerCase() !== 'false',
), // Enabled by default
expiryInHours: process.env.EXPIRY_IN_HOURS || 12,
dbDataDir: 'data/db_cache',
};
Expand Down

0 comments on commit 2a4ad06

Please sign in to comment.