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

Remove targeting set filter bidcache #4236

Merged
merged 1 commit into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions src/auctionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function newAuctionManager() {
auctionManager.addWinningBid = function(bid) {
const auction = find(_auctions, auction => auction.getAuctionId() === bid.auctionId);
if (auction) {
bid.status = CONSTANTS.BID_STATUS.RENDERED;
auction.addWinningBid(bid);
} else {
utils.logWarn(`Auction not found when adding winning bid`);
Expand Down
1 change: 0 additions & 1 deletion src/prebid.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ $$PREBID_GLOBAL$$.renderAd = function (doc, id) {
// lookup ad by ad Id
const bid = auctionManager.findBidByAdId(id);
if (bid) {
bid.status = CONSTANTS.BID_STATUS.RENDERED;
// replace macros according to openRTB with price paid = bid.cpm
bid.ad = utils.replaceAuctionPrice(bid.ad, bid.cpm);
bid.adUrl = utils.replaceAuctionPrice(bid.adUrl, bid.cpm);
Expand Down
4 changes: 2 additions & 2 deletions src/targeting.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export const TARGETING_KEYS = Object.keys(CONSTANTS.TARGETING_KEYS).map(
// return unexpired bids
const isBidNotExpired = (bid) => (bid.responseTimestamp + bid.ttl * 1000 + TTL_BUFFER) > timestamp();

// return bids whose status is not set. Winning bid can have status `targetingSet` or `rendered`.
const isUnusedBid = (bid) => bid && ((bid.status && !includes([CONSTANTS.BID_STATUS.BID_TARGETING_SET, CONSTANTS.BID_STATUS.RENDERED], bid.status)) || !bid.status);
// return bids whose status is not set. Winning bids can only have a status of `rendered`.
const isUnusedBid = (bid) => bid && ((bid.status && !includes([CONSTANTS.BID_STATUS.RENDERED], bid.status)) || !bid.status);

export let filters = {
isBidNotExpired,
Expand Down