fix: add back existence check

This commit is contained in:
Friedel Ziegelmayer 2016-10-28 11:55:16 +02:00
parent 1a33adc001
commit 0b940faf22

View File

@ -39,6 +39,11 @@ class Cache {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// console.log("load cache:", cacheFile) // console.log("load cache:", cacheFile)
store.exists(cacheFile, (err, exists) => {
if (err || !exists) {
return resolve()
}
filePath = cacheFile filePath = cacheFile
pull( pull(
store.read(cacheFile), store.read(cacheFile),
@ -51,6 +56,7 @@ class Cache {
}) })
) )
}) })
})
} }
static reset() { static reset() {