Skip to content

Commit adbc53c

Browse files
mkendall07florevallatmrf
authored andcommitted
give s2s request the same amount of time from the client side (prebid#2790)
* give s2s request the same amount of time from the client side, ie do not abort early * missed auctionjs
1 parent f6b10c6 commit adbc53c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/adaptermanager.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ exports.checkBidRequestSizes = (adUnits) => {
281281
return adUnits;
282282
}
283283

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

295295
if (serverBidRequests.length) {
296-
const s2sAjax = ajaxBuilder(serverBidRequests[0].timeout, requestCallbacks ? {
296+
// s2s should get the same client side timeout as other client side requests.
297+
const s2sAjax = ajaxBuilder(requestBidsTimeout, requestCallbacks ? {
297298
request: requestCallbacks.request.bind(null, 's2s'),
298299
done: requestCallbacks.done
299300
} : undefined);
@@ -356,7 +357,7 @@ exports.callBids = (adUnits, bidRequests, addBidResponse, doneCb, requestCallbac
356357
events.emit(CONSTANTS.EVENTS.BID_REQUESTED, bidRequest);
357358
bidRequest.doneCbCallCount = 0;
358359
let done = doneCb(bidRequest.bidderRequestId);
359-
let ajax = ajaxBuilder(clientBidRequests[0].timeout, requestCallbacks ? {
360+
let ajax = ajaxBuilder(requestBidsTimeout, requestCallbacks ? {
360361
request: requestCallbacks.request.bind(null, bidRequest.bidderCode),
361362
done: requestCallbacks.done
362363
} : undefined);

src/auction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export function newAuction({adUnits, adUnitCodes, callback, cbTimeout, labels})
229229
}
230230
}
231231
}
232-
});
232+
}, _timeout);
233233
}
234234
};
235235

0 commit comments

Comments
 (0)