Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Commit

Permalink
fix caching problem
Browse files Browse the repository at this point in the history
It counts if I fixed it by removing the cache, right? Part of taking
care of npm/npm#7074.
  • Loading branch information
othiym23 committed Apr 3, 2015
1 parent d307d82 commit b746f65
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"github-url-from-username-repo": "~1.0.0",
"glob": "^4.0.2",
"json-parse-helpfulerror": "^1.0.2",
"lru-cache": "2",
"normalize-package-data": "^1.0.0"
},
"devDependencies": {
Expand Down
12 changes: 0 additions & 12 deletions read-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ try {

module.exports = readJson

var LRU = require("lru-cache")
readJson.cache = new LRU({max: 1000})
var path = require("path")
var glob = require("glob")
var normalizeData = require("normalize-package-data")
Expand Down Expand Up @@ -42,15 +40,6 @@ function readJson (file, log_, strict_, cb_) {
if (!log) log = function () {};
cb = arguments[ arguments.length - 1 ]

var c = readJson.cache.get(file)
if (c) {
cb = cb.bind(null, null, c)
return process.nextTick(cb);
}
cb = (function (orig) { return function (er, data) {
if (data) readJson.cache.set(file, data);
return orig(er, data)
} })(cb)
readJson_(file, log, strict, cb)
}

Expand Down Expand Up @@ -372,7 +361,6 @@ function final (file, data, log, strict, cb) {
}
checkBinReferences_(file, data, warn, function () {
typoWarned[pId] = true
readJson.cache.set(file, data)
cb(null, data)
})
}
Expand Down

0 comments on commit b746f65

Please sign in to comment.