Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapter alias - syncer changes #3082

Merged
merged 19 commits into from
Sep 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions usersync/syncersbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ func (e SyncerBuildError) Error() string {
}

func BuildSyncers(hostConfig *config.Configuration, bidderInfos config.BidderInfos) (map[string]Syncer, []error) {
// map syncer config by bidder
cfgByBidder := make(map[string]config.Syncer, len(bidderInfos))
biddersWithSyncerCfg := make(map[string]config.BidderInfo, len(bidderInfos))
for bidder, bidderInfo := range bidderInfos {
if shouldCreateSyncer(bidderInfo) {
cfgByBidder[bidder] = *bidderInfo.Syncer
biddersWithSyncerCfg[bidder] = bidderInfo
onkarvhanumante marked this conversation as resolved.
Show resolved Hide resolved
}
}

// map syncer config by key
cfgBySyncerKey := make(map[string][]namedSyncerConfig, len(bidderInfos))
for bidder, cfg := range cfgByBidder {
if cfg.Key == "" {
cfg.Key = bidder
for bidder, bidderInfo := range biddersWithSyncerCfg {
syncerCopy := *bidderInfo.Syncer
if syncerCopy.Key == "" {
syncerCopy.Key = bidder
}
cfgBySyncerKey[cfg.Key] = append(cfgBySyncerKey[cfg.Key], namedSyncerConfig{bidder, cfg})
cfgBySyncerKey[syncerCopy.Key] = append(cfgBySyncerKey[syncerCopy.Key], namedSyncerConfig{bidder, syncerCopy})
}

// resolve host endpoint
Expand Down