diff --git a/lib/platform/github/gh-got-wrapper.js b/lib/platform/github/gh-got-wrapper.js index b628009ab70105ffe0b5bc17d2b468a06561ea3d..9ac5d79e6a154b84855c42ffe30c3df9bd1efac7 100644 --- a/lib/platform/github/gh-got-wrapper.js +++ b/lib/platform/github/gh-got-wrapper.js @@ -9,7 +9,8 @@ async function get(path, opts, retries = 5) { /* eslint-disable no-param-reassign */ opts = Object.assign({}, opts); const method = opts.method ? opts.method : 'get'; - if (method === 'get' && cache[path]) { + const useCache = opts.useCache || true; + if (method === 'get' && useCache && cache[path]) { logger.trace({ path }, 'Returning cached result'); return cache[path]; } diff --git a/lib/platform/gitlab/gl-got-wrapper.js b/lib/platform/gitlab/gl-got-wrapper.js index e517af745b250b6bf40fadcbbf41b83212db847e..4e3b0a0db64fd93aebc96eea601b5347cc2c3841 100644 --- a/lib/platform/gitlab/gl-got-wrapper.js +++ b/lib/platform/gitlab/gl-got-wrapper.js @@ -4,14 +4,17 @@ const parseLinkHeader = require('parse-link-header'); let cache = {}; async function get(path, opts, retries = 5) { - const method = opts && opts.method ? opts.method : 'get'; - if (method === 'get' && cache[path]) { + /* eslint-disable no-param-reassign */ + opts = Object.assign({}, opts); + const method = opts.method ? opts.method : 'get'; + const useCache = opts.useCache || true; + if (method === 'get' && useCache && cache[path]) { logger.debug({ path }, 'Returning cached result'); return cache[path]; } logger.debug({ path }, method.toUpperCase()); const res = await glGot(path, opts); - if (opts && opts.paginate) { + if (opts.paginate) { // Check if result is paginated try { const linkHeader = parseLinkHeader(res.headers.link);