Skip to content

Commit

Permalink
minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
onkarvhanumante committed Sep 8, 2023
1 parent de6d33a commit 8a54873
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions usersync/syncersbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ func chooseSyncerConfig(biddersSyncerConfig []namedSyncerConfig) (namedSyncerCon
return namedSyncerConfig{}, fmt.Errorf("bidders %s define endpoints (iframe and/or redirect) for the same syncer key, but only one bidder is permitted to define endpoints", bidders)
}

// check if alias bidders of different parent have same syncer key
if len(parentBidderNameMap) > 1 {
sort.Strings(aliasBidderNames)
return namedSyncerConfig{}, fmt.Errorf("alias bidders %s of different parents defines endpoints (iframe and/or redirect) for the same syncer key, but only one bidder is permitted to define endpoints", strings.Join(aliasBidderNames, ", "))
}

// check if aliases of same parent and non-alias bidder have same syncer key
if len(parentBidderNameMap) != 0 {
// check if alias bidders of different parent have same syncer key
if len(parentBidderNameMap) > 1 {
sort.Strings(aliasBidderNames)
return namedSyncerConfig{}, fmt.Errorf("alias bidders %s of different parents defines endpoints (iframe and/or redirect) for the same syncer key, but only one bidder is permitted to define endpoints", strings.Join(aliasBidderNames, ", "))
}

// check if aliases of same parent and non-alias bidder have same syncer key
if _, ok := parentBidderNameMap[nonAliasBidderNames[0]]; !ok {
sort.Strings(aliasBidderNames)
return namedSyncerConfig{}, fmt.Errorf("alias bidders %s and non-alias bidder %s defines endpoints (iframe and/or redirect) for the same syncer key, but only one bidder is permitted to define endpoints", strings.Join(aliasBidderNames, ", "), nonAliasBidderNames[0])
Expand Down

0 comments on commit 8a54873

Please sign in to comment.