From 3cdca2851794fc88a46b4c5f8b92dbe2dd8a1deb Mon Sep 17 00:00:00 2001 From: Jaimin Panchal Date: Wed, 20 Dec 2017 10:55:44 -0500 Subject: [PATCH 1/2] removed s2s defaults --- modules/serverbidServerBidAdapter.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/modules/serverbidServerBidAdapter.js b/modules/serverbidServerBidAdapter.js index 47d4e518222..4ff8992772f 100644 --- a/modules/serverbidServerBidAdapter.js +++ b/modules/serverbidServerBidAdapter.js @@ -10,13 +10,8 @@ const getConfig = config.getConfig; const REQUIRED_S2S_CONFIG_KEYS = ['siteId', 'networkId', 'bidders', 'endpoint']; let _s2sConfig; -config.setDefaults({ - 's2sConfig': { - enabled: false, - timeout: 1000, - adapter: 'serverbidServer' - } -}); + +const bidder = 'serverbidServer'; var ServerBidServerAdapter; ServerBidServerAdapter = function ServerBidServerAdapter() { @@ -61,6 +56,8 @@ ServerBidServerAdapter = function ServerBidServerAdapter() { sizeMap[43] = '300x600'; function setS2sConfig(options) { + if (options.adapter != bidder) return; + let contains = (xs, x) => xs.indexOf(x) > -1; let userConfig = Object.keys(options); @@ -231,6 +228,6 @@ ServerBidServerAdapter.createNew = function() { return new ServerBidServerAdapter(); }; -adaptermanager.registerBidAdapter(new ServerBidServerAdapter(), 'serverbidServer'); +adaptermanager.registerBidAdapter(new ServerBidServerAdapter(), bidder); module.exports = ServerBidServerAdapter; From adbc966c3675ff39d3b935b27d0e552c333bd28d Mon Sep 17 00:00:00 2001 From: Jaimin Panchal Date: Wed, 20 Dec 2017 10:56:11 -0500 Subject: [PATCH 2/2] start timestamp was missing on s2s requests --- src/adaptermanager.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/adaptermanager.js b/src/adaptermanager.js index 670b329ef72..c8dc72e7ddc 100644 --- a/src/adaptermanager.js +++ b/src/adaptermanager.js @@ -1,6 +1,6 @@ /** @module adaptermanger */ -import { flatten, getBidderCodes, getDefinedParams, shuffle } from './utils'; +import { flatten, getBidderCodes, getDefinedParams, shuffle, timestamp } from './utils'; import { resolveStatus } from './sizeMapping'; import { processNativeAdUnitParams, nativeAdapters } from './native'; import { newBidder } from './adapters/bidderFactory'; @@ -234,6 +234,7 @@ exports.callBids = (adUnits, bidRequests, addBidResponse, doneCb) => { let s2sBidRequest = {tid, 'ad_units': adUnitsS2SCopy}; if (s2sBidRequest.ad_units.length) { let doneCbs = serverBidRequests.map(bidRequest => { + bidRequest.start = timestamp(); bidRequest.doneCbCallCount = 0; return doneCb(bidRequest.bidderRequestId) }); @@ -265,7 +266,7 @@ exports.callBids = (adUnits, bidRequests, addBidResponse, doneCb) => { // handle client adapter requests clientBidRequests.forEach(bidRequest => { - bidRequest.start = new Date().getTime(); + bidRequest.start = timestamp(); // TODO : Do we check for bid in pool from here and skip calling adapter again ? const adapter = _bidderRegistry[bidRequest.bidderCode]; if (adapter) {