From e93b71c0f367cc4868275704bd94a3ee13f7a739 Mon Sep 17 00:00:00 2001 From: saneery Date: Tue, 23 Jul 2019 09:56:17 +0300 Subject: [PATCH] Rename cache ttl to cache period --- apps/explorer/config/config.exs | 8 ++++---- apps/explorer/lib/explorer/market/market_history_cache.ex | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/explorer/config/config.exs b/apps/explorer/config/config.exs index 606b5c6f0c..fed5124a2a 100644 --- a/apps/explorer/config/config.exs +++ b/apps/explorer/config/config.exs @@ -18,7 +18,7 @@ config :explorer, healthy_blocks_period: System.get_env("HEALTHY_BLOCKS_PERIOD") || :timer.minutes(5) average_block_period = - case Integer.parse(System.get_env("AVERAGE_BLOCK_PERIOD", "")) do + case Integer.parse(System.get_env("AVERAGE_BLOCK_CACHE_PERIOD", "")) do {secs, ""} -> :timer.seconds(secs) _ -> :timer.minutes(30) end @@ -114,13 +114,13 @@ config :spandex_ecto, SpandexEcto.EctoLogger, tracer: Explorer.Tracer, otp_app: :explorer -market_history_cache_ttl = - case Integer.parse(System.get_env("MARKET_HISTORY_CACHE_TTL", "")) do +market_history_cache_period = + case Integer.parse(System.get_env("MARKET_HISTORY_CACHE_PERIOD", "")) do {secs, ""} -> :timer.seconds(secs) _ -> :timer.hours(6) end -config :explorer, Explorer.Market.MarketHistoryCache, ttl: market_history_cache_ttl +config :explorer, Explorer.Market.MarketHistoryCache, period: market_history_cache_period # 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/market/market_history_cache.ex b/apps/explorer/lib/explorer/market/market_history_cache.ex index 5cddb7707a..4ed3d9b7d2 100644 --- a/apps/explorer/lib/explorer/market/market_history_cache.ex +++ b/apps/explorer/lib/explorer/market/market_history_cache.ex @@ -12,7 +12,7 @@ defmodule Explorer.Market.MarketHistoryCache do @last_update_key :last_update @history_key :history # 6 hours - @cache_period Application.get_env(:explorer, __MODULE__)[:ttl] + @cache_period Application.get_env(:explorer, __MODULE__)[:period] @recent_days 30 def fetch do