deduplicate input data

pull/1423/head
Ayrat Badykov 6 years ago
parent ff0db8c32b
commit 5cf4f86020
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 6
      apps/explorer/lib/explorer/chain/import/runner/block/rewards.ex

@ -53,7 +53,11 @@ defmodule Explorer.Chain.Import.Runner.Block.Rewards do
on_conflict = Map.get_lazy(options, :on_conflict, &default_on_conflict/0)
# order so that row ShareLocks are grabbed in a consistent order
ordered_changes_list = Enum.sort_by(changes_list, &{&1.address_hash, &1.address_type, &1.block_hash})
ordered_changes_list =
changes_list
|> Enum.uniq_by(&{&1.address_hash, &1.address_type, &1.block_hash})
|> Enum.sort_by(&{&1.address_hash, &1.address_type, &1.block_hash})
Import.insert_changes_list(
repo,

Loading…
Cancel
Save