From be1623b07eef672132e5e949e07ea4ee71348a43 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Tue, 7 May 2019 14:56:43 +0300 Subject: [PATCH] fix System.get_env("BLOCK_COUNT_CACHE_TTL") type --- apps/explorer/config/config.exs | 3 ++- apps/explorer/lib/explorer/chain/block_count_cache.ex | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/explorer/config/config.exs b/apps/explorer/config/config.exs index ace69884ea..f40e10371b 100644 --- a/apps/explorer/config/config.exs +++ b/apps/explorer/config/config.exs @@ -82,7 +82,8 @@ config :spandex_ecto, SpandexEcto.EctoLogger, tracer: Explorer.Tracer, otp_app: :explorer -config :explorer, Explorer.Chain.BlockCountCache, ttl: System.get_env("BLOCK_COUNT_CACHE_TTL") +config :explorer, Explorer.Chain.BlockCountCache, + ttl: System.get_env("BLOCK_COUNT_CACHE_TTL") && String.to_integer(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. diff --git a/apps/explorer/lib/explorer/chain/block_count_cache.ex b/apps/explorer/lib/explorer/chain/block_count_cache.ex index 7c900bfedd..84f016dd44 100644 --- a/apps/explorer/lib/explorer/chain/block_count_cache.ex +++ b/apps/explorer/lib/explorer/chain/block_count_cache.ex @@ -6,8 +6,8 @@ defmodule Explorer.Chain.BlockCountCache do alias Explorer.Chain @tab :block_count_cache - # 1 minutes - @cache_period 1_000 * 60 + # 10 minutes + @cache_period 1_000 * 60 * 10 @key "count" @opts_key "opts"