Skip to content

Commit

Permalink
fixes #178 ensure package.json cache is expired immediately when new …
Browse files Browse the repository at this point in the history
…version is published to npm
  • Loading branch information
alanshaw committed Feb 26, 2016
1 parent 9cb2156 commit 973e2ff
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ exports.getManifest = function (user, repo, path, ref, authToken, cb) {
manifestKey += "/" + path
}

if (ref) {
manifestKey += "/#" + ref
}
manifestKey += "/#" + (ref || '')

db.get(manifestKey, function (er, manifest) {
if (er && !er.notFound) return cb(er)
Expand Down Expand Up @@ -206,7 +204,7 @@ registry.on("change", function (change) {
var keys = batch.map(function (b) { return b.key })

db.batch(batch, function (er) {
if (er) console.error("Failed to expire cached manifest", keys, er)
if (er) return console.error("Failed to expire cached manifest", keys, er)
console.log("Expired cached manifest", keys)
})
})
Expand Down

0 comments on commit 973e2ff

Please sign in to comment.