Skip to content

Commit

Permalink
give s2s request the same amount of time from the client side (prebid…
Browse files Browse the repository at this point in the history
…#2790)

* give s2s request the same amount of time from the client side, ie do not abort early

* missed auctionjs
  • Loading branch information
mkendall07 authored and florevallatmrf committed Sep 6, 2018
1 parent f6b10c6 commit adbc53c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/adaptermanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ exports.checkBidRequestSizes = (adUnits) => {
return adUnits;
}

exports.callBids = (adUnits, bidRequests, addBidResponse, doneCb, requestCallbacks) => {
exports.callBids = (adUnits, bidRequests, addBidResponse, doneCb, requestCallbacks, requestBidsTimeout) => {
if (!bidRequests.length) {
utils.logWarn('callBids executed with no bidRequests. Were they filtered by labels or sizing?');
return;
Expand All @@ -293,7 +293,8 @@ exports.callBids = (adUnits, bidRequests, addBidResponse, doneCb, requestCallbac
}, [[], []]);

if (serverBidRequests.length) {
const s2sAjax = ajaxBuilder(serverBidRequests[0].timeout, requestCallbacks ? {
// s2s should get the same client side timeout as other client side requests.
const s2sAjax = ajaxBuilder(requestBidsTimeout, requestCallbacks ? {
request: requestCallbacks.request.bind(null, 's2s'),
done: requestCallbacks.done
} : undefined);
Expand Down Expand Up @@ -356,7 +357,7 @@ exports.callBids = (adUnits, bidRequests, addBidResponse, doneCb, requestCallbac
events.emit(CONSTANTS.EVENTS.BID_REQUESTED, bidRequest);
bidRequest.doneCbCallCount = 0;
let done = doneCb(bidRequest.bidderRequestId);
let ajax = ajaxBuilder(clientBidRequests[0].timeout, requestCallbacks ? {
let ajax = ajaxBuilder(requestBidsTimeout, requestCallbacks ? {
request: requestCallbacks.request.bind(null, bidRequest.bidderCode),
done: requestCallbacks.done
} : undefined);
Expand Down
2 changes: 1 addition & 1 deletion src/auction.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export function newAuction({adUnits, adUnitCodes, callback, cbTimeout, labels})
}
}
}
});
}, _timeout);
}
};

Expand Down

0 comments on commit adbc53c

Please sign in to comment.