worker: fix crash due to caches (fix #588)
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/602/head
parent
3113b0041e
commit
f1834e31ba
|
@ -22,11 +22,11 @@ const pendingUrls = new Map<string, BlobCallback[]>();
|
||||||
// Cache for preview images
|
// Cache for preview images
|
||||||
const cacheName = "images";
|
const cacheName = "images";
|
||||||
let imageCache: Cache;
|
let imageCache: Cache;
|
||||||
caches
|
self.caches
|
||||||
.open(cacheName)
|
?.open(cacheName)
|
||||||
.then((c) => (imageCache = c))
|
.then((c) => (imageCache = c))
|
||||||
.catch(() => {
|
.catch((e) => {
|
||||||
/* ignore */
|
console.warn("Failed to open cache in worker", e);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Expiration for cache
|
// Expiration for cache
|
||||||
|
|
Loading…
Reference in New Issue