Skip to content

Commit fec3d9e

Browse files
committed
fund: fix request caching
1 parent a8a2001 commit fec3d9e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/support.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,18 @@ function downloadSupportData (supportablePackages, cb) {
150150
var cached = cache.get(url)
151151
if (cached) {
152152
return setImmediate(function () {
153-
cb(null, {cached: true}, cached)
153+
cb(null, { cached: true }, cached)
154154
})
155155
}
156156
simpleGet.concat({
157157
url: url,
158158
json: true,
159159
headers: headers
160-
}, cb)
160+
}, function (err, response, data) {
161+
if (err) return cb(err)
162+
cache.set(url, data)
163+
cb(null, response, data)
164+
})
161165
}
162166
}
163167

0 commit comments

Comments
 (0)