Skip to content
Browse files

Completely prevent calls to fetch_rates()

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

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

# fetch_rates()

{:noreply, state}
@@ -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()

{:noreply, state}

0 comments on commit 21bb2c8

Please sign in to comment.
You can’t perform that action at this time.