|
|
|
@ -21,16 +21,8 @@ defmodule Indexer.Fetcher.InternalTransaction do |
|
|
|
|
|
|
|
|
|
@behaviour BufferedTask |
|
|
|
|
|
|
|
|
|
@max_batch_size 10 |
|
|
|
|
@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] |
|
|
|
|
] |
|
|
|
|
@default_max_batch_size 10 |
|
|
|
|
@default_max_concurrency 4 |
|
|
|
|
|
|
|
|
|
@doc """ |
|
|
|
|
Asynchronously fetches internal transactions. |
|
|
|
@ -68,7 +60,7 @@ defmodule Indexer.Fetcher.InternalTransaction do |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
merged_init_opts = |
|
|
|
|
@defaults |
|
|
|
|
defaults() |
|
|
|
|
|> Keyword.merge(mergeable_init_options) |
|
|
|
|
|> Keyword.put(:state, state) |
|
|
|
|
|
|
|
|
@ -273,4 +265,15 @@ defmodule Indexer.Fetcher.InternalTransaction do |
|
|
|
|
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 |
|
|
|
|