Skip to content

Commit

Permalink
improve duplicate logging
Browse files Browse the repository at this point in the history
  • Loading branch information
shurwit committed Dec 20, 2024
1 parent a2db8e5 commit 3f9e6c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions driven/storage/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ func (sa *Adapter) constructTenantsAccountsForOrg(orgID string, accounts []accou
}

func (sa *Adapter) verifyNotExist(accounts []account) bool {
success := true
for _, acc := range accounts {
for _, acc2 := range accounts {
if acc.ID == acc2.ID {
Expand All @@ -240,11 +241,12 @@ func (sa *Adapter) verifyNotExist(accounts []account) bool {

if sa.containsIdentifier(acc.Identifiers, acc2.Identifiers) {
sa.logger.ErrorWithFields("duplicate identifier", logutils.Fields{"account1_id": acc.ID, "account2_id": acc2.ID})
return false
success = false
// return false
}
}
}
return true
return success
}

func (sa *Adapter) containsIdentifier(identifiers1 []accountIdentifier, identifiers2 []accountIdentifier) bool {
Expand Down

0 comments on commit 3f9e6c9

Please sign in to comment.