Skip to content

Commit

Permalink
Completely prevent calls to fetch_rates()
Browse files Browse the repository at this point in the history
The error handling in exchange_rates.ex unconditionally reschedules a
call to get the exchange rates for each failed request. Since they
always do fail, each request will end up in an 'infinite loop'.

Since blockscout will schedule new exchange rates calls to be done,
those 'infinite loops' pile up, since we will never have a successful
call.

We end up with lots of processes basically only waiting and spamming
our logs.
  • Loading branch information
schmir committed Jan 20, 2020
1 parent b8ac0a5 commit 21bb2c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/explorer/lib/explorer/exchange_rates/exchange_rates.ex
Expand Up @@ -19,7 +19,7 @@ defmodule Explorer.ExchangeRates do
def handle_info(:update, state) do
Logger.debug(fn -> "Updating cached exchange rates" end)

fetch_rates()
# fetch_rates()

{:noreply, state}
end
Expand All @@ -42,7 +42,7 @@ defmodule Explorer.ExchangeRates do
def handle_info({_ref, {:error, reason}}, state) do
Logger.warn(fn -> "Failed to get exchange rates with reason '#{reason}'." end)

fetch_rates()
# fetch_rates()

{:noreply, state}
end
Expand Down

0 comments on commit 21bb2c8

Please sign in to comment.