start cache in repo process

pull/1388/head
Ayrat Badykov 6 years ago
parent b13466a046
commit 1068c5f775
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 7
      apps/explorer/lib/explorer/application.ex
  2. 4
      apps/explorer/lib/explorer/chain/block_number_cache.ex
  3. 2
      apps/explorer/test/explorer/chain/block_number_cache_test.exs

@ -12,7 +12,6 @@ defmodule Explorer.Application do
@impl Application @impl Application
def start(_type, _args) do def start(_type, _args) do
PrometheusLogger.setup() PrometheusLogger.setup()
BlockNumberCache.setup()
:telemetry.attach( :telemetry.attach(
"prometheus-ecto", "prometheus-ecto",
@ -35,7 +34,11 @@ defmodule Explorer.Application do
opts = [strategy: :one_for_one, name: Explorer.Supervisor] opts = [strategy: :one_for_one, name: Explorer.Supervisor]
Supervisor.start_link(children, opts) res = Supervisor.start_link(children, opts)
BlockNumberCache.setup()
res
end end
defp configurable_children do defp configurable_children do

@ -1,4 +1,8 @@
defmodule Explorer.Chain.BlockNumberCache do defmodule Explorer.Chain.BlockNumberCache do
@moduledoc """
Cache for max and min block numbers.
"""
alias Explorer.Chain alias Explorer.Chain
@tab :block_number_cache @tab :block_number_cache

@ -1,4 +1,4 @@
defmodule Explorer.ChainTest do defmodule Explorer.Chain.BlockNumberCacheTest do
use Explorer.DataCase use Explorer.DataCase
alias Explorer.Chain.BlockNumberCache alias Explorer.Chain.BlockNumberCache

Loading…
Cancel
Save