Change default ttl_check_interval for counters on the main page

pull/3446/head
Victor Baranov 4 years ago
parent e0b276e111
commit 3e690f590e
  1. 1
      CHANGELOG.md
  2. 8
      apps/explorer/lib/explorer/chain/cache/block_count.ex
  3. 4
      apps/explorer/lib/explorer/chain/cache/gas_usage.ex
  4. 2
      apps/explorer/lib/explorer/chain/cache/transaction_count.ex

@ -48,6 +48,7 @@
- [#3335](https://github.com/poanetwork/blockscout/pull/3335) - MarketCap calculation: check that ETS tables exist before inserting new data or lookup from the table - [#3335](https://github.com/poanetwork/blockscout/pull/3335) - MarketCap calculation: check that ETS tables exist before inserting new data or lookup from the table
### Chore ### Chore
- [#3446](https://github.com/poanetwork/blockscout/pull/3446) - Change default ttl_check_interval for counters on the main page
- [#3431](https://github.com/poanetwork/blockscout/pull/3431) - Standardize token name definition, if name is empty - [#3431](https://github.com/poanetwork/blockscout/pull/3431) - Standardize token name definition, if name is empty
- [#3421](https://github.com/poanetwork/blockscout/pull/3421) - Functions to enable GnosisSafe app link - [#3421](https://github.com/poanetwork/blockscout/pull/3421) - Functions to enable GnosisSafe app link
- [#3414](https://github.com/poanetwork/blockscout/pull/3414) - Manage lis of other explorers in the footer via env var - [#3414](https://github.com/poanetwork/blockscout/pull/3414) - Manage lis of other explorers in the footer via env var

@ -3,18 +3,18 @@ defmodule Explorer.Chain.Cache.BlockCount do
Cache for block count. Cache for block count.
""" """
require Logger @default_cache_period :timer.hours(2)
@default_cache_period :timer.minutes(10)
use Explorer.Chain.MapCache, use Explorer.Chain.MapCache,
name: :block_count, name: :block_count,
key: :count, key: :count,
key: :async_task, key: :async_task,
global_ttl: cache_period(), global_ttl: cache_period(),
ttl_check_interval: :timer.minutes(1), ttl_check_interval: :timer.minutes(15),
callback: &async_task_on_deletion(&1) callback: &async_task_on_deletion(&1)
require Logger
alias Explorer.Chain alias Explorer.Chain
defp handle_fallback(:count) do defp handle_fallback(:count) do

@ -5,14 +5,14 @@ defmodule Explorer.Chain.Cache.GasUsage do
require Logger require Logger
@default_cache_period :timer.minutes(30) @default_cache_period :timer.hours(2)
use Explorer.Chain.MapCache, use Explorer.Chain.MapCache,
name: :gas_usage, name: :gas_usage,
key: :sum, key: :sum,
key: :async_task, key: :async_task,
global_ttl: cache_period(), global_ttl: cache_period(),
ttl_check_interval: :timer.minutes(1), ttl_check_interval: :timer.minutes(15),
callback: &async_task_on_deletion(&1) callback: &async_task_on_deletion(&1)
alias Explorer.Chain alias Explorer.Chain

@ -10,7 +10,7 @@ defmodule Explorer.Chain.Cache.TransactionCount do
key: :count, key: :count,
key: :async_task, key: :async_task,
global_ttl: cache_period(), global_ttl: cache_period(),
ttl_check_interval: :timer.minutes(10), ttl_check_interval: :timer.minutes(15),
callback: &async_task_on_deletion(&1) callback: &async_task_on_deletion(&1)
require Logger require Logger

Loading…
Cancel
Save