|
|
@ -16,6 +16,7 @@ defmodule Indexer.Temporary.AddressesWithoutCode do |
|
|
|
|
|
|
|
|
|
|
|
@task_options [max_concurrency: 3, timeout: :infinity] |
|
|
|
@task_options [max_concurrency: 3, timeout: :infinity] |
|
|
|
@batch_size 500 |
|
|
|
@batch_size 500 |
|
|
|
|
|
|
|
@query_timeout :infinity |
|
|
|
|
|
|
|
|
|
|
|
def start_link([fetcher, gen_server_options]) do |
|
|
|
def start_link([fetcher, gen_server_options]) do |
|
|
|
GenServer.start_link(__MODULE__, fetcher, gen_server_options) |
|
|
|
GenServer.start_link(__MODULE__, fetcher, gen_server_options) |
|
|
@ -104,7 +105,7 @@ defmodule Indexer.Temporary.AddressesWithoutCode do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
defp process_query(query, fetcher) do |
|
|
|
defp process_query(query, fetcher) do |
|
|
|
query_stream = Repo.stream(query, max_rows: @batch_size) |
|
|
|
query_stream = Repo.stream(query, max_rows: @batch_size, timeout: @query_timeout) |
|
|
|
|
|
|
|
|
|
|
|
stream = |
|
|
|
stream = |
|
|
|
TaskSupervisor |
|
|
|
TaskSupervisor |
|
|
@ -114,7 +115,7 @@ defmodule Indexer.Temporary.AddressesWithoutCode do |
|
|
|
@task_options |
|
|
|
@task_options |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
Repo.transaction(fn -> Stream.run(stream) end) |
|
|
|
Repo.transaction(fn -> Stream.run(stream) end, timeout: @query_timeout) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def refetch_block(block, fetcher) do |
|
|
|
def refetch_block(block, fetcher) do |
|
|
|