Skip to content

Commit

Permalink
Update targeting.js to fix TTL buffer arithmetic (#6300)
Browse files Browse the repository at this point in the history
  • Loading branch information
patmmccann authored Feb 12, 2021
1 parent 6cc1ec3 commit 2ea3f6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/targeting.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const TARGETING_KEYS = Object.keys(CONSTANTS.TARGETING_KEYS).map(
);

// return unexpired bids
const isBidNotExpired = (bid) => (bid.responseTimestamp + bid.ttl * 1000 + TTL_BUFFER) > timestamp();
const isBidNotExpired = (bid) => (bid.responseTimestamp + bid.ttl * 1000 - TTL_BUFFER) > timestamp();

// 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);
Expand Down

0 comments on commit 2ea3f6f

Please sign in to comment.