Skip to content

Commit

Permalink
Merge pull request #45 from AstraProtocol/dev
Browse files Browse the repository at this point in the history
chore: retry fetch internal txs when reorgs occur
  • Loading branch information
trungnt1811 authored Sep 14, 2023
2 parents b48ec29 + 175595c commit d79b7d2
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions apps/indexer/lib/indexer/fetcher/internal_transaction.ex
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,14 @@ defmodule Indexer.Fetcher.InternalTransaction do
Logger.error(fn -> ["failed to fetch internal transactions for blocks: ", inspect(reason)] end,
error_count: filtered_unique_numbers_count
)
try do
tx_hash = Enum.at(reason, 0)[:data][:transaction_hash]
Chain.update_txs_has_error_in_internal_txs(tx_hash)
rescue
_ ->
:ok
end
#try do
# tx_hash = Enum.at(reason, 0)[:data][:transaction_hash]
# Chain.update_txs_has_error_in_internal_txs(tx_hash)
#rescue
# _ ->
# :ok
#end


# re-queue the de-duped entries
{:retry, filtered_unique_numbers}
Expand Down Expand Up @@ -185,8 +186,8 @@ defmodule Indexer.Fetcher.InternalTransaction do
cond do
blank_input?(param[:input]) == true ->
false
!is_nil(param[:has_error_in_internal_txs]) ->
false
#!is_nil(param[:has_error_in_internal_txs]) ->
# false
true ->
true
end
Expand Down

0 comments on commit d79b7d2

Please sign in to comment.