Skip to content

Commit

Permalink
Added checking deal priority before attempting key update
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Rice committed Feb 11, 2020
1 parent c4a7998 commit 722a83b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions exchange/exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,12 @@ func applyDealSupport(bidRequest *openrtb.BidRequest, auc *auction) []error {
for bidderName, topBidPerBidder := range topBidsPerImp {
bidderString := bidderName.String()

if validateDealTier(impDeal[bidderString]) {
updateCatDur(topBidPerBidder, impDeal[bidderString].Info)
} else {
errs = append(errs, fmt.Errorf("dealTier configuration invalid for bidder '%s', imp ID '%s'", bidderString, impID))
if topBidPerBidder.dealPriority > 0 {
if validateDealTier(impDeal[bidderString]) {
updateCatDur(topBidPerBidder, impDeal[bidderString].Info)
} else {
errs = append(errs, fmt.Errorf("dealTier configuration invalid for bidder '%s', imp ID '%s'", bidderString, impID))
}
}
}
}
Expand Down

0 comments on commit 722a83b

Please sign in to comment.