realtime_interval -> block_interval / 2

The realtime_interval should be half of the block_interval to ensure
that we don't get stuck in a state where we just miss a new block
because using precisely the block rate doesn't account for processing
time.  The exact value of half the block_interval was chosen for the
Nyquist rules.
pull/439/head
Luke Imhoff 6 years ago
parent fe49a753d3
commit 75e2bfccc0
  1. 2
      apps/indexer/lib/indexer/block_fetcher.ex

@ -71,7 +71,7 @@ defmodule Indexer.BlockFetcher do
json_rpc_named_arguments: Keyword.fetch!(opts, :json_rpc_named_arguments),
genesis_task: nil,
realtime_task: nil,
realtime_interval: opts[:block_interval] || @block_interval,
realtime_interval: div(opts[:block_interval] || @block_interval, 2),
starting_block_number: nil,
blocks_batch_size: Keyword.get(opts, :blocks_batch_size, @blocks_batch_size),
blocks_concurrency: Keyword.get(opts, :blocks_concurrency, @blocks_concurrency),

Loading…
Cancel
Save