|
|
@ -21,16 +21,8 @@ defmodule Indexer.Fetcher.InternalTransaction do |
|
|
|
|
|
|
|
|
|
|
|
@behaviour BufferedTask |
|
|
|
@behaviour BufferedTask |
|
|
|
|
|
|
|
|
|
|
|
@max_batch_size 10 |
|
|
|
@default_max_batch_size 10 |
|
|
|
@max_concurrency 4 |
|
|
|
@default_max_concurrency 4 |
|
|
|
@defaults [ |
|
|
|
|
|
|
|
flush_interval: :timer.seconds(3), |
|
|
|
|
|
|
|
max_concurrency: @max_concurrency, |
|
|
|
|
|
|
|
max_batch_size: @max_batch_size, |
|
|
|
|
|
|
|
poll: true, |
|
|
|
|
|
|
|
task_supervisor: Indexer.Fetcher.InternalTransaction.TaskSupervisor, |
|
|
|
|
|
|
|
metadata: [fetcher: :internal_transaction] |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@doc """ |
|
|
|
@doc """ |
|
|
|
Asynchronously fetches internal transactions. |
|
|
|
Asynchronously fetches internal transactions. |
|
|
@ -68,7 +60,7 @@ defmodule Indexer.Fetcher.InternalTransaction do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
merged_init_opts = |
|
|
|
merged_init_opts = |
|
|
|
@defaults |
|
|
|
defaults() |
|
|
|
|> Keyword.merge(mergeable_init_options) |
|
|
|
|> Keyword.merge(mergeable_init_options) |
|
|
|
|> Keyword.put(:state, state) |
|
|
|
|> Keyword.put(:state, state) |
|
|
|
|
|
|
|
|
|
|
@ -273,4 +265,15 @@ defmodule Indexer.Fetcher.InternalTransaction do |
|
|
|
end |
|
|
|
end |
|
|
|
end) |
|
|
|
end) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defp defaults do |
|
|
|
|
|
|
|
[ |
|
|
|
|
|
|
|
flush_interval: :timer.seconds(3), |
|
|
|
|
|
|
|
max_concurrency: Application.get_env(:indexer, __MODULE__)[:concurrency] || @default_max_concurrency, |
|
|
|
|
|
|
|
max_batch_size: Application.get_env(:indexer, __MODULE__)[:batch_size] || @default_max_batch_size, |
|
|
|
|
|
|
|
poll: true, |
|
|
|
|
|
|
|
task_supervisor: Indexer.Fetcher.InternalTransaction.TaskSupervisor, |
|
|
|
|
|
|
|
metadata: [fetcher: :internal_transaction] |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|