diff --git a/lib/workers/pr/changelog/source-cache.js b/lib/workers/pr/changelog/source-cache.js index d850c9dce659e7cfaa2d221fda52680e09efa2ab..46e3c93e36eeb99445a11c14a5690849c3457a93 100644 --- a/lib/workers/pr/changelog/source-cache.js +++ b/lib/workers/pr/changelog/source-cache.js @@ -22,19 +22,18 @@ async function getChangeLogJSON(args) { const cacheVal = await cacache.get(...cache); logger.trace(`Returning cached version of ${depName}`); const cachedResult = JSON.parse(cacheVal.data.toString()); - if (cachedResult) { - if (DateTime.local() < DateTime.fromISO(cachedResult.expiry)) { - logger.debug('Cache hit'); - delete cachedResult.expiry; - return cachedResult; - } - logger.debug('Cache expiry'); + if ( + cachedResult && + DateTime.local() < DateTime.fromISO(cachedResult.expiry) + ) { + logger.debug('Cache hit'); + delete cachedResult.expiry; + return cachedResult; } - return null; } catch (err) { logger.debug('Cache miss'); - return null; } + return null; } async function setChangeLogJSON(args, res) {