Change min safe polling period

pull/3028/head
Victor Baranov 5 years ago
parent f4d6c1a666
commit 908f6a1fa7
  1. 1
      CHANGELOG.md
  2. 4
      apps/indexer/lib/indexer/block/realtime/fetcher.ex

@ -7,6 +7,7 @@
- [#2834](https://github.com/poanetwork/blockscout/pull/2834) - always redirect to checksummed hash
### Fixes
- [#3028](https://github.com/poanetwork/blockscout/pull/3028) - Decrease polling period value for realtime fetcher
- [#3027](https://github.com/poanetwork/blockscout/pull/3027) - Rescue for SUPPORTED_CHAINS env var parsing
- [#3025](https://github.com/poanetwork/blockscout/pull/3025) - Fix splitting of indexer/web components setup
- [#3024](https://github.com/poanetwork/blockscout/pull/3024) - Fix pool size default value in config

@ -37,7 +37,7 @@ defmodule Indexer.Block.Realtime.Fetcher do
@behaviour Block.Fetcher
@minimum_safe_polling_period :timer.seconds(10)
@minimum_safe_polling_period :timer.seconds(5)
@enforce_keys ~w(block_fetcher)a
defstruct ~w(block_fetcher subscription previous_number max_number_seen timer)a
@ -157,7 +157,7 @@ defmodule Indexer.Block.Realtime.Fetcher do
polling_period =
case AverageBlockTime.average_block_time() do
{:error, :disabled} -> 2_000
block_time -> round(Duration.to_milliseconds(block_time) * 2)
block_time -> round(Duration.to_milliseconds(block_time) / 2)
end
safe_polling_period = max(polling_period, @minimum_safe_polling_period)

Loading…
Cancel
Save