From 6f0b477777964d6ff56a6e9ec4c3b40181587ccb Mon Sep 17 00:00:00 2001
From: Rhys Arkins <rhys@arkins.net>
Date: Mon, 3 Sep 2018 18:57:20 +0200
Subject: [PATCH] fix: revert pagination cache

---
 lib/platform/github/gh-got-wrapper.js | 28 ---------------------------
 1 file changed, 28 deletions(-)

diff --git a/lib/platform/github/gh-got-wrapper.js b/lib/platform/github/gh-got-wrapper.js
index c3fe00c262..c5789abbb3 100644
--- a/lib/platform/github/gh-got-wrapper.js
+++ b/lib/platform/github/gh-got-wrapper.js
@@ -42,23 +42,6 @@ async function get(path, options, retries = 5) {
       const pageLimit = opts.pageLimit || 10;
       const linkHeader = parseLinkHeader(res.headers.link);
       if (linkHeader && linkHeader.next && linkHeader.last) {
-        const { etag } = res.headers;
-        const cacheNamespace = 'github-pagination';
-        // istanbul ignore next
-        try {
-          const cacheResult = await renovateCache.get(cacheNamespace, path);
-          if (cacheResult.etag === etag) {
-            logger.debug({ path }, 'Returning cached paginated result');
-            res.body = cacheResult.body;
-            return res;
-          }
-          logger.debug(
-            { oldEtag: cacheResult.etag, newEtag: etag, path },
-            'Outdated pagination cache'
-          );
-        } catch (err) {
-          logger.trace({ path }, 'Paginated cache miss');
-        }
         let lastPage = +linkHeader.last.page;
         if (!process.env.RENOVATE_PAGINATE_ALL) {
           lastPage = Math.min(pageLimit, lastPage);
@@ -78,17 +61,6 @@ async function get(path, options, retries = 5) {
         res.body = res.body.concat(
           ...pages.filter(Boolean).map(page => page.body)
         );
-        try {
-          const cacheMinutes = 60 * 24;
-          await renovateCache.set(
-            cacheNamespace,
-            path,
-            { etag, body: res.body },
-            cacheMinutes
-          );
-        } catch (err) /* istanbul ignore next */ {
-          logger.warn('Error setting renovateCache value');
-        }
       }
     }
     if (
-- 
GitLab