diff --git a/apps/explorer/config/config.exs b/apps/explorer/config/config.exs index ace69884ea..e6eb5c4813 100644 --- a/apps/explorer/config/config.exs +++ b/apps/explorer/config/config.exs @@ -82,8 +82,6 @@ config :spandex_ecto, SpandexEcto.EctoLogger, tracer: Explorer.Tracer, otp_app: :explorer -config :explorer, Explorer.Chain.BlockCountCache, ttl: System.get_env("BLOCK_COUNT_CACHE_TTL") - # Import environment specific config. This must remain at the bottom # of this file so it overrides the configuration defined above. import_config "#{Mix.env()}.exs" diff --git a/apps/explorer/test/explorer/chain/block_count_cache_test.exs b/apps/explorer/test/explorer/chain/block_count_cache_test.exs index afc75e9d32..dcf7299278 100644 --- a/apps/explorer/test/explorer/chain/block_count_cache_test.exs +++ b/apps/explorer/test/explorer/chain/block_count_cache_test.exs @@ -4,52 +4,52 @@ defmodule Explorer.Chain.BlockCountCacheTest do alias Explorer.Chain.BlockCountCache test "returns default transaction count" do - BlockCountCache.start_link([[], [name: TestCache]]) + BlockCountCache.start_link([name: BlockTestCache]) - result = BlockCountCache.value(TestCache) + result = BlockCountCache.count(BlockTestCache) assert is_nil(result) end test "updates cache if initial value is zero" do - BlockCountCache.start_link([[], [name: TestCache]]) + BlockCountCache.start_link([name: BlockTestCache]) insert(:block, consensus: true) insert(:block, consensus: true) insert(:block, consensus: false) - _result = BlockCountCache.value(TestCache) + _result = BlockCountCache.count(BlockTestCache) Process.sleep(1000) - updated_value = BlockCountCache.value(TestCache) + updated_value = BlockCountCache.count(BlockTestCache) assert updated_value == 2 end test "does not update cache if cache period did not pass" do - BlockCountCache.start_link([[], [name: TestCache]]) + BlockCountCache.start_link([name: BlockTestCache]) insert(:block, consensus: true) insert(:block, consensus: true) insert(:block, consensus: false) - _result = BlockCountCache.value(TestCache) + _result = BlockCountCache.count(BlockTestCache) Process.sleep(1000) - updated_value = BlockCountCache.value(TestCache) + updated_value = BlockCountCache.count(BlockTestCache) assert updated_value == 2 insert(:block, consensus: true) insert(:block, consensus: true) - _updated_value = BlockCountCache.value(TestCache) + _updated_value = BlockCountCache.count(BlockTestCache) Process.sleep(1000) - updated_value = BlockCountCache.value(TestCache) + updated_value = BlockCountCache.count(BlockTestCache) assert updated_value == 2 end