chore: Token transfers broadcast optimization (#10465)

pull/10469/head
Qwerty5Uiop 4 months ago committed by GitHub
parent b6634290b1
commit b140e9f5b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 17
      apps/block_scout_web/lib/block_scout_web/notifier.ex

@ -177,16 +177,13 @@ defmodule BlockScoutWeb.Notifier do
def handle_event({:chain_event, :token_transfers, :realtime, all_token_transfers}) do
all_token_transfers_full =
all_token_transfers
|> Enum.map(
&(&1
|> Repo.preload(
DenormalizationHelper.extend_transaction_preload([
:token,
:transaction,
from_address: [:names, :smart_contract, :proxy_implementations],
to_address: [:names, :smart_contract, :proxy_implementations]
])
))
|> Repo.preload(
DenormalizationHelper.extend_transaction_preload([
:token,
:transaction,
from_address: [:names, :smart_contract, :proxy_implementations],
to_address: [:names, :smart_contract, :proxy_implementations]
])
)
transfers_by_token = Enum.group_by(all_token_transfers_full, fn tt -> to_string(tt.token_contract_address_hash) end)

Loading…
Cancel
Save