diff --git a/lib/platform/github/gh-got-wrapper.js b/lib/platform/github/gh-got-wrapper.js index d963097d663232c2a6fe4adc578618263827e7c3..11dac1623a8fbfd77a9a1930a55f1120adca83c0 100644 --- a/lib/platform/github/gh-got-wrapper.js +++ b/lib/platform/github/gh-got-wrapper.js @@ -5,8 +5,6 @@ const pAll = require('p-all'); const got = require('../../util/got'); const { maskToken } = require('../../util/mask'); -let stats = {}; - const hostType = 'github'; let baseUrl = 'https://api.github.com/'; @@ -23,9 +21,6 @@ async function get(path, options, okToRetry = true) { opts.baseUrl = opts.baseUrl.replace('/v3/', '/'); } logger.trace(`${method.toUpperCase()} ${path}`); - stats.requests = (stats.requests || []).concat([ - method.toUpperCase() + ' ' + path, - ]); try { if (global.appMode) { const appAccept = 'application/vnd.github.machine-man-preview+json'; @@ -44,10 +39,6 @@ async function get(path, options, okToRetry = true) { } } const res = await got(path, opts); - if (res && res.headers) { - stats.rateLimit = res.headers['x-ratelimit-limit']; - stats.rateLimitRemaining = res.headers['x-ratelimit-remaining']; - } if (opts.paginate) { // Check if result is paginated const pageLimit = opts.pageLimit || 10; @@ -165,23 +156,6 @@ get.setAppMode = function setAppMode() { // no-op }; -get.reset = function reset() { - // istanbul ignore if - if (stats.requests && stats.requests.length > 1) { - logger.info( - { - rateLimit: parseInt(stats.rateLimit, 10), - requestCount: stats.requests.length, - rateLimitRemaining: parseInt(stats.rateLimitRemaining, 10), - }, - 'Request stats' - ); - stats.requests.sort(); - logger.debug({ requests: stats.requests }, 'All requests'); - stats = {}; - } -}; - get.setBaseUrl = u => { baseUrl = u; }; diff --git a/lib/platform/github/index.js b/lib/platform/github/index.js index fd66d09f06dd5e24c0fabe5218a7bba57948fbe2..b8f6c3106b03b2232a59b6d20780fda7f5da7236 100644 --- a/lib/platform/github/index.js +++ b/lib/platform/github/index.js @@ -135,7 +135,6 @@ function cleanRepo() { config.storage.cleanRepo(); } // In theory most of this isn't necessary. In practice.. - get.reset(); config = {}; } diff --git a/test/platform/github/gh-got-wrapper.spec.js b/test/platform/github/gh-got-wrapper.spec.js index a21971926794b7d925a5779ae65634130182e375..179642b79a99f42f3757f387748f26b90c903f61 100644 --- a/test/platform/github/gh-got-wrapper.spec.js +++ b/test/platform/github/gh-got-wrapper.spec.js @@ -8,7 +8,6 @@ jest.mock('delay'); describe('platform/gh-got-wrapper', () => { beforeEach(() => { jest.resetAllMocks(); - get.reset(); delete global.appMode; delay.mockImplementation(() => Promise.resolve()); });