|
|
|
@ -2247,7 +2247,7 @@ defmodule Explorer.Chain do |
|
|
|
|
when accumulator: term() |
|
|
|
|
def stream_unfetched_token_balances(initial, reducer, limited? \\ false) when is_function(reducer, 2) do |
|
|
|
|
TokenBalance.unfetched_token_balances() |
|
|
|
|
|> add_fetcher_limit(limited?) |
|
|
|
|
|> add_token_balances_fetcher_limit(limited?) |
|
|
|
|
|> Repo.stream_reduce(initial, reducer) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
@ -6307,6 +6307,14 @@ defmodule Explorer.Chain do |
|
|
|
|
limit(query, ^fetcher_limit) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
defp add_token_balances_fetcher_limit(query, false), do: query |
|
|
|
|
|
|
|
|
|
defp add_token_balances_fetcher_limit(query, true) do |
|
|
|
|
token_balances_fetcher_limit = Application.get_env(:indexer, :token_balances_fetcher_init_limit) |
|
|
|
|
|
|
|
|
|
limit(query, ^token_balances_fetcher_limit) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def put_has_token_transfers_to_tx(query, true), do: query |
|
|
|
|
|
|
|
|
|
def put_has_token_transfers_to_tx(query, false) do |
|
|
|
|