Skip to content

Commit

Permalink
fund: fix request caching
Browse files Browse the repository at this point in the history
  • Loading branch information
kemitchell committed Sep 6, 2019
1 parent a8a2001 commit fec3d9e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,18 @@ function downloadSupportData (supportablePackages, cb) {
var cached = cache.get(url)
if (cached) {
return setImmediate(function () {
cb(null, {cached: true}, cached)
cb(null, { cached: true }, cached)
})
}
simpleGet.concat({
url: url,
json: true,
headers: headers
}, cb)
}, function (err, response, data) {
if (err) return cb(err)
cache.set(url, data)
cb(null, response, data)
})
}
}

Expand Down

0 comments on commit fec3d9e

Please sign in to comment.