make coinmarketcap's number of pages configurable

pull/1802/head
Ayrat Badykov 6 years ago
parent e93ecb510c
commit da2c79de7c
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 3
      apps/explorer/config/config.exs
  2. 2
      apps/explorer/lib/explorer/exchange_rates/source/coin_market_cap.ex

@ -13,6 +13,9 @@ config :explorer,
config :explorer, Explorer.Counters.AverageBlockTime, enabled: true
config :explorer, Explorer.ExchangeRates.Source.CoinMarketCap,
pages: String.to_integer(System.get_env("COINMARKETCAP_PAGES") || "10")
balances_update_interval =
if System.get_env("ADDRESS_WITH_BALANCES_UPDATE_INTERVAL") do
case Integer.parse(System.get_env("ADDRESS_WITH_BALANCES_UPDATE_INTERVAL")) do

@ -38,7 +38,7 @@ defmodule Explorer.ExchangeRates.Source.CoinMarketCap do
"#{base_url()}/v1/ticker/?start=#{page - 1}00"
end
def max_page_number, do: 10
def max_page_number, do: config(:pages) || 10
defp base_url do
config(:base_url) || "https://api.coinmarketcap.com"

Loading…
Cancel
Save