fetch env without raise

pull/1855/head
saneery 6 years ago
parent 23b5355f23
commit 7e0f3cba33
  1. 4
      apps/explorer/lib/explorer/application.ex
  2. 4
      apps/explorer/lib/explorer/exchange_rates/exchange_rates.ex
  3. 4
      apps/explorer/lib/explorer/known_tokens/known_tokens.ex

@ -56,9 +56,7 @@ defmodule Explorer.Application do
end end
defp should_start?(process) do defp should_start?(process) do
:explorer Application.get_env(:explorer, process, [])[:enabled] == true
|> Application.fetch_env!(process)
|> Keyword.fetch!(:enabled)
end end
defp configure(process) do defp configure(process) do

@ -135,8 +135,6 @@ defmodule Explorer.ExchangeRates do
end end
defp enabled? do defp enabled? do
:explorer Application.get_env(:explorer, __MODULE__, [])[:enabled] == true
|> Application.fetch_env!(__MODULE__)
|> Keyword.fetch!(:enabled)
end end
end end

@ -134,8 +134,6 @@ defmodule Explorer.KnownTokens do
end end
defp enabled? do defp enabled? do
:explorer Application.get_env(:explorer, __MODULE__, [])[:enabled] == true
|> Application.fetch_env!(__MODULE__)
|> Keyword.fetch!(:enabled)
end end
end end

Loading…
Cancel
Save