Add `MARKET_HISTORY_FETCH_INTERVAL` env (#9197)

pull/9132/head
Maxim Filonov 10 months ago committed by GitHub
parent d3209f0e2e
commit ecde63be6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 7
      apps/explorer/lib/explorer/market/history/cataloger.ex
  3. 4
      config/runtime.exs

@ -30,6 +30,7 @@
### Chore ### Chore
- [#9198](https://github.com/blockscout/blockscout/pull/9198) - Make Postgres@15 default option - [#9198](https://github.com/blockscout/blockscout/pull/9198) - Make Postgres@15 default option
- [#9197](https://github.com/blockscout/blockscout/pull/9197) - Add `MARKET_HISTORY_FETCH_INTERVAL` env
- [#9196](https://github.com/blockscout/blockscout/pull/9196) - Compatibility with docker-compose 2.24 - [#9196](https://github.com/blockscout/blockscout/pull/9196) - Compatibility with docker-compose 2.24
- [#9193](https://github.com/blockscout/blockscout/pull/9193) - Equalize elixir stack versions - [#9193](https://github.com/blockscout/blockscout/pull/9193) - Equalize elixir stack versions

@ -4,10 +4,9 @@ defmodule Explorer.Market.History.Cataloger do
Market grabs the last 365 day's worth of market history for the configured Market grabs the last 365 day's worth of market history for the configured
coin in the explorer. Once that data is fetched, current day's values are coin in the explorer. Once that data is fetched, current day's values are
checked every 60 minutes. Additionally, failed requests to the history checked every `MARKET_HISTORY_FETCH_INTERVAL` or every 60 minutes by default.
source will follow exponential backoff `100ms * 2^(n+1)` where `n` is the Additionally, failed requests to the history source will follow exponential
number of failed requests. backoff `100ms * 2^(n+1)` where `n` is the number of failed requests.
""" """
use GenServer use GenServer

@ -312,7 +312,9 @@ config :explorer, Explorer.ExchangeRates.TokenExchangeRates,
refetch_interval: ConfigHelper.parse_time_env_var("TOKEN_EXCHANGE_RATE_REFETCH_INTERVAL", "1h"), refetch_interval: ConfigHelper.parse_time_env_var("TOKEN_EXCHANGE_RATE_REFETCH_INTERVAL", "1h"),
max_batch_size: ConfigHelper.parse_integer_env_var("TOKEN_EXCHANGE_RATE_MAX_BATCH_SIZE", 150) max_batch_size: ConfigHelper.parse_integer_env_var("TOKEN_EXCHANGE_RATE_MAX_BATCH_SIZE", 150)
config :explorer, Explorer.Market.History.Cataloger, enabled: !disable_indexer? && !disable_exchange_rates? config :explorer, Explorer.Market.History.Cataloger,
enabled: !disable_indexer? && !disable_exchange_rates?,
history_fetch_interval: ConfigHelper.parse_time_env_var("MARKET_HISTORY_FETCH_INTERVAL", "1h")
config :explorer, Explorer.Chain.Transaction, suave_bid_contracts: System.get_env("SUAVE_BID_CONTRACTS", "") config :explorer, Explorer.Chain.Transaction, suave_bid_contracts: System.get_env("SUAVE_BID_CONTRACTS", "")

Loading…
Cancel
Save