|
|
@ -189,16 +189,29 @@ defmodule Indexer.Block.Uncle.Fetcher do |
|
|
|
|
|
|
|
|
|
|
|
defp retry(errors) when is_list(errors) do |
|
|
|
defp retry(errors) when is_list(errors) do |
|
|
|
retried_entries = errors_to_entries(errors) |
|
|
|
retried_entries = errors_to_entries(errors) |
|
|
|
|
|
|
|
loggable_errors = loggable_errors(errors) |
|
|
|
|
|
|
|
loggable_error_count = Enum.count(loggable_errors) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unless loggable_error_count == 0 do |
|
|
|
|
|
|
|
Logger.error( |
|
|
|
|
|
|
|
fn -> |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
"failed to fetch: ", |
|
|
|
|
|
|
|
errors_to_iodata(loggable_errors) |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
end, |
|
|
|
|
|
|
|
error_count: loggable_error_count |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
Logger.error( |
|
|
|
{:retry, retried_entries} |
|
|
|
fn -> |
|
|
|
end |
|
|
|
[ |
|
|
|
|
|
|
|
"failed to fetch: ", |
|
|
|
defp loggable_errors(errors) when is_list(errors) do |
|
|
|
errors_to_iodata(errors) |
|
|
|
Enum.filter(errors, fn |
|
|
|
] |
|
|
|
%{code: 404, message: "Not Found"} -> false |
|
|
|
end, |
|
|
|
_ -> true |
|
|
|
error_count: Enum.count(retried_entries) |
|
|
|
end) |
|
|
|
) |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
defp errors_to_entries(errors) when is_list(errors) do |
|
|
|
defp errors_to_entries(errors) when is_list(errors) do |
|
|
|