do not fail block `internal_transactions_indexed_at` field update

this runner updates internal_transactions_index_at field in blocks
table. but before this, it checks if these blocks are consensus, some
blocks may lose consensus.

we just shouldn't check if the number of updated records is exactly
equal to the number of records that we want to insert.
blocks that lost consensus will be re-fetched
pull/2738/head
Ayrat Badykov 5 years ago
parent 6d461f574c
commit 6b7e1ce2fe
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 2
      apps/explorer/lib/explorer/chain/import/runner/internal_transactions_indexed_at_blocks.ex

@ -68,7 +68,7 @@ defmodule Explorer.Chain.Import.Runner.InternalTransactionsIndexedAtBlocks do
block_count = Enum.count(block_numbers)
try do
{^block_count, result} =
{_, result} =
repo.update_all(
from(b in Block, join: s in subquery(query), on: b.hash == s.hash),
[set: [internal_transactions_indexed_at: timestamps.updated_at]],

Loading…
Cancel
Save