Skip to content

Commit

Permalink
Swaps: Add cache thresholds configuration (#2514)
Browse files Browse the repository at this point in the history
  • Loading branch information
wachunei authored Apr 23, 2021
1 parent c7b93e5 commit 59fa84a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/core/AppConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ export default {
CLIENT_ID: 'mobile',
LIVENESS_POLLING_FREQUENCY: 5 * 60 * 1000,
POLL_COUNT_LIMIT: 3,
DEFAULT_SLIPPAGE: 3
DEFAULT_SLIPPAGE: 3,
CACHE_AGGREGATOR_METADATA_THRESHOLD: 5 * 60 * 1000,
CACHE_TOKENS_THRESHOLD: 5 * 60 * 1000,
CACHE_TOP_ASSETS_THRESHOLD: 5 * 60 * 1000
},
MAX_SAFE_CHAIN_ID: 4503599627370476,
URLS: {
Expand Down
7 changes: 6 additions & 1 deletion app/core/Engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ class Engine {
new TokenRatesController(),
new TransactionController(),
new TypedMessageManager(),
new SwapsController({ clientId: AppConstants.SWAPS.CLIENT_ID })
new SwapsController({
clientId: AppConstants.SWAPS.CLIENT_ID,
fetchAggregatorMetadataThreshold: AppConstants.SWAPS.CACHE_AGGREGATOR_METADATA_THRESHOLD,
fetchTokensThreshold: AppConstants.SWAPS.CACHE_TOKENS_THRESHOLD,
fetchTopAssetsThreshold: AppConstants.SWAPS.CACHE_TOP_ASSETS_THRESHOLD
})
],
initialState
);
Expand Down

0 comments on commit 59fa84a

Please sign in to comment.