Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: retry fetch internal txs when reorgs occur #45

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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