Skip to content

Commit

Permalink
Revert "UOE-10137: Fetch platform type from wrapper profile table (#727
Browse files Browse the repository at this point in the history
…)"

This reverts commit c0423b8.
  • Loading branch information
pm-priyanka-bagade committed Apr 11, 2024
1 parent 3b2e3b8 commit 1beada9
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 149 deletions.
15 changes: 5 additions & 10 deletions modules/pubmatic/openwrap/database/mysql/partner_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,14 @@ import (
// return the list of active server side header bidding partners
// with their configurations at publisher-profile-version level
func (db *mySqlDB) GetActivePartnerConfigurations(pubID, profileID int, displayVersion int) (map[int]map[string]string, error) {
versionID, displayVersionID, platform, err := db.getVersionID(profileID, displayVersion, pubID)
versionID, displayVersionID, err := db.getVersionID(profileID, displayVersion, pubID)
if err != nil {
return nil, err
}

partnerConfigMap, err := db.getActivePartnerConfigurations(versionID)
if err == nil && partnerConfigMap[-1] != nil {
partnerConfigMap[-1][models.DisplayVersionID] = strconv.Itoa(displayVersionID)
// check for SDK new UI
if platform != "" {
partnerConfigMap[-1][models.PLATFORM_KEY] = platform
}
}
return partnerConfigMap, err
}
Expand Down Expand Up @@ -80,19 +76,18 @@ func (db *mySqlDB) getActivePartnerConfigurations(versionID int) (map[int]map[st
return partnerConfigMap, nil
}

func (db *mySqlDB) getVersionID(profileID, displayVersion, pubID int) (int, int, string, error) {
func (db *mySqlDB) getVersionID(profileID, displayVersion, pubID int) (int, int, error) {
var row *sql.Row
if displayVersion == 0 {
row = db.conn.QueryRow(db.cfg.Queries.LiveVersionInnerQuery, profileID, pubID)
} else {
row = db.conn.QueryRow(db.cfg.Queries.DisplayVersionInnerQuery, profileID, displayVersion, pubID)
}

var platform sql.NullString
var versionID, displayVersionIDFromDB int
err := row.Scan(&versionID, &displayVersionIDFromDB, &platform)
err := row.Scan(&versionID, &displayVersionIDFromDB)
if err != nil {
return versionID, displayVersionIDFromDB, platform.String, err
return versionID, displayVersionIDFromDB, err
}
return versionID, displayVersionIDFromDB, platform.String, nil
return versionID, displayVersionIDFromDB, nil
}
Loading

0 comments on commit 1beada9

Please sign in to comment.