From 2ddc880a358d662ca7d6c8f8e55615b3edf5d192 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Fri, 6 Nov 2020 11:29:30 +0300 Subject: [PATCH] Eliminate deadlock on CurrentTokenBalance insertion --- .../chain/import/runner/address/current_token_balances.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/explorer/lib/explorer/chain/import/runner/address/current_token_balances.ex b/apps/explorer/lib/explorer/chain/import/runner/address/current_token_balances.ex index 3a570c011f..ce3a22a365 100644 --- a/apps/explorer/lib/explorer/chain/import/runner/address/current_token_balances.ex +++ b/apps/explorer/lib/explorer/chain/import/runner/address/current_token_balances.ex @@ -201,7 +201,7 @@ defmodule Explorer.Chain.Import.Runner.Address.CurrentTokenBalances do on_conflict = Map.get_lazy(options, :on_conflict, &default_on_conflict/0) # Enforce CurrentTokenBalance ShareLocks order (see docs: sharelocks.md) - ordered_changes_list = Enum.sort_by(changes_list, &{&1.address_hash, &1.token_contract_address_hash}) + ordered_changes_list = Enum.sort_by(changes_list, &{&1.token_contract_address_hash, &1.address_hash}) Import.insert_changes_list( repo,