|
|
@ -310,9 +310,10 @@ defmodule Explorer.Chain.Cache.GasPriceOracle do |
|
|
|
defp fast_time_coefficient, do: Application.get_env(:explorer, __MODULE__)[:fast_time_coefficient] |
|
|
|
defp fast_time_coefficient, do: Application.get_env(:explorer, __MODULE__)[:fast_time_coefficient] |
|
|
|
|
|
|
|
|
|
|
|
defp handle_fallback(:gas_prices) do |
|
|
|
defp handle_fallback(:gas_prices) do |
|
|
|
# This will get the task PID if one exists and launch a new task if not |
|
|
|
# This will get the task PID if one exists, check if it's running and launch |
|
|
|
|
|
|
|
# a new task if task doesn't exist or it's not running. |
|
|
|
# See next `handle_fallback` definition |
|
|
|
# See next `handle_fallback` definition |
|
|
|
get_async_task() |
|
|
|
safe_get_async_task() |
|
|
|
|
|
|
|
|
|
|
|
{:return, get_old_gas_prices()} |
|
|
|
{:return, get_old_gas_prices()} |
|
|
|
end |
|
|
|
end |
|
|
@ -353,7 +354,7 @@ defmodule Explorer.Chain.Cache.GasPriceOracle do |
|
|
|
# `gas_prices` expires (unless there is one already running) |
|
|
|
# `gas_prices` expires (unless there is one already running) |
|
|
|
defp async_task_on_deletion({:delete, _, :gas_prices}) do |
|
|
|
defp async_task_on_deletion({:delete, _, :gas_prices}) do |
|
|
|
set_old_gas_prices(get_gas_prices()) |
|
|
|
set_old_gas_prices(get_gas_prices()) |
|
|
|
get_async_task() |
|
|
|
safe_get_async_task() |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
defp async_task_on_deletion(_data), do: nil |
|
|
|
defp async_task_on_deletion(_data), do: nil |
|
|
|