@ -18,7 +18,11 @@ defmodule Explorer.Chain.Cache.AddressSum do
defp handle_fallback(:sum) do
result = fetch_from_db()
{:update, result}
if Application.get_env(:explorer, __MODULE__)[:enabled] do
else
{:return, result}
end
defp fetch_from_db do
@ -12,7 +12,7 @@ defmodule Explorer.Chain.Cache.AddressSumTest do
test "returns default address sum" do
result = AddressSum.get_sum()
assert is_nil(result)
assert result == 0
test "updates cache if initial value is zero" do