From 7e0f3cba33384414f4cdfb78b249b0a11de260f1 Mon Sep 17 00:00:00 2001 From: saneery Date: Wed, 1 May 2019 13:16:53 +0300 Subject: [PATCH] fetch env without raise --- apps/explorer/lib/explorer/application.ex | 4 +--- apps/explorer/lib/explorer/exchange_rates/exchange_rates.ex | 4 +--- apps/explorer/lib/explorer/known_tokens/known_tokens.ex | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/apps/explorer/lib/explorer/application.ex b/apps/explorer/lib/explorer/application.ex index 080b880211..47b30cfa2b 100644 --- a/apps/explorer/lib/explorer/application.ex +++ b/apps/explorer/lib/explorer/application.ex @@ -56,9 +56,7 @@ defmodule Explorer.Application do end defp should_start?(process) do - :explorer - |> Application.fetch_env!(process) - |> Keyword.fetch!(:enabled) + Application.get_env(:explorer, process, [])[:enabled] == true end defp configure(process) do diff --git a/apps/explorer/lib/explorer/exchange_rates/exchange_rates.ex b/apps/explorer/lib/explorer/exchange_rates/exchange_rates.ex index b4dc0229f9..f0ed6f0f54 100644 --- a/apps/explorer/lib/explorer/exchange_rates/exchange_rates.ex +++ b/apps/explorer/lib/explorer/exchange_rates/exchange_rates.ex @@ -135,8 +135,6 @@ defmodule Explorer.ExchangeRates do end defp enabled? do - :explorer - |> Application.fetch_env!(__MODULE__) - |> Keyword.fetch!(:enabled) + Application.get_env(:explorer, __MODULE__, [])[:enabled] == true end end diff --git a/apps/explorer/lib/explorer/known_tokens/known_tokens.ex b/apps/explorer/lib/explorer/known_tokens/known_tokens.ex index caca671540..aff9dea74b 100644 --- a/apps/explorer/lib/explorer/known_tokens/known_tokens.ex +++ b/apps/explorer/lib/explorer/known_tokens/known_tokens.ex @@ -134,8 +134,6 @@ defmodule Explorer.KnownTokens do end defp enabled? do - :explorer - |> Application.fetch_env!(__MODULE__) - |> Keyword.fetch!(:enabled) + Application.get_env(:explorer, __MODULE__, [])[:enabled] == true end end