@ -18,7 +18,11 @@ defmodule Explorer.Chain.Cache.AddressSum do
defp handle_fallback(:sum) do
result = fetch_from_db()
if Application.get_env(:explorer, __MODULE__)[:enabled] do
{:update, result}
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