mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-07-03 02:52:30 +00:00
fix: add back existence check
This commit is contained in:
parent
1a33adc001
commit
0b940faf22
@ -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() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user