Skip to content

Commit

Permalink
revert: "feat: PB-804 Redis Fix Option" (prebid#280) ♻️
Browse files Browse the repository at this point in the history
This reverts commit fe95b42.
  • Loading branch information
Sergey Shcherbakov authored Jul 24, 2023
1 parent fe95b42 commit 4e3579f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 56 deletions.
19 changes: 9 additions & 10 deletions endpoints/openrtb2/auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ func (deps *endpointDeps) Auction(w http.ResponseWriter, r *http.Request, _ http
ctx = ctx_helpers.SetUnitID(ctx, extNextMillennium.UnitID)
requestExt.SetNextMillennium(extNextMillennium)
}
deps.parseBuyerUIDs(ctx, req)

timeout := deps.cfg.AuctionTimeouts.LimitAuctionTimeout(time.Duration(req.TMax) * time.Millisecond)
if timeout > 0 {
Expand All @@ -220,8 +221,6 @@ func (deps *endpointDeps) Auction(w http.ResponseWriter, r *http.Request, _ http
ao.TimeoutMS = timeout.Milliseconds()

usersyncs := usersync.ParseCookieFromRequest(r, &(deps.cfg.HostCookie))
deps.parseBuyerUIDs(ctx, req, extNextMillennium, usersyncs)

if req.App != nil {
labels.Source = metrics.DemandApp
labels.RType = metrics.ReqTypeORTB2App
Expand Down Expand Up @@ -335,7 +334,7 @@ func (deps *endpointDeps) Auction(w http.ResponseWriter, r *http.Request, _ http
}
}

func (deps *endpointDeps) parseBuyerUIDs(ctx context.Context, req *openrtb_ext.RequestWrapper, extNmm *openrtb_ext.ExtRequestNextMillennium, usersyncs *usersync.Cookie) {
func (deps *endpointDeps) parseBuyerUIDs(ctx context.Context, req *openrtb_ext.RequestWrapper) {
userExt, err := req.GetUserExt()
if err != nil {
return
Expand All @@ -345,18 +344,18 @@ func (deps *endpointDeps) parseBuyerUIDs(ctx context.Context, req *openrtb_ext.R
if prebid == nil {
prebid = &openrtb_ext.ExtUserPrebid{}
}
if extNmm == nil {
extNmm = &openrtb_ext.ExtRequestNextMillennium{}
}
if usersyncs == nil {
usersyncs = &usersync.Cookie{}
}

if user := req.BidRequest.User; user != nil {
if uids, err := deps.redis.Get(ctx, user.BuyerUID); err == nil {
var uidsMap map[string]string
if err = json.Unmarshal(uids, &uidsMap); err == nil {
nextmillennium.SetBuyerUids(uidsMap, usersyncs, *extNmm, user, prebid)
prebid.BuyerUIDs = make(map[string]string)
for bidder, uid := range uidsMap {
if bidder == "rubicon" && user.BuyerUID == "" {
continue
}
prebid.BuyerUIDs[bidder] = uid
}
req.BidRequest.User.BuyerUID = ""
}
}
Expand Down
3 changes: 0 additions & 3 deletions nextmillennium/browser_targeting.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ func contains(s []string, e string) bool {
}
return false
}
func Contains(s []string, e string) bool {
return contains(s, e)
}

var deviceTypeInts = map[string]int{
"Computer": 2,
Expand Down
42 changes: 0 additions & 42 deletions nextmillennium/setBuyerUids.go

This file was deleted.

1 change: 0 additions & 1 deletion openrtb_ext/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ type ExtRequestNextMillennium struct {
OverwriteSChain bool `json:"overwriteSChain,omitempty"`
ReqDealIds map[string]string `json:"reqDealIds,omitempty"`
Comscore bool `json:"comscore,omitempty"`
RedisFixBidders map[string]uint8 `json:"redisFixBidders,omitempty"`
}
type ExtRequestNextMillenniumGeo struct {
Country string `json:"country,omitempty"`
Expand Down

0 comments on commit 4e3579f

Please sign in to comment.