Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

Commit

Permalink
fix(cache): pretend cache entry is missing on ENOENT
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Apr 4, 2017
1 parent 4429eb5 commit 9c2bb26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ module.exports = class Cache {
}
return new this.Promise((resolve, reject) => {
fs.stat(info.path, (err, stat) => {
if (err) {
return reject(err)
if (err && err !== 'ENOENT') {
return resolve(err)
} else {
return resolve(stat)
}
})
}).then(stat => {
if (!stat) { return }
const cachePath = this._path
let disturbed = false
// avoid opening cache file handles until a user actually tries to
Expand Down

0 comments on commit 9c2bb26

Please sign in to comment.