fix unhandled runtime error, and ignore doesn't exist error
This commit is contained in:
parent
ebc65741a4
commit
0dd6dadd12
1 changed files with 8 additions and 2 deletions
|
@ -35,7 +35,10 @@ export class DiskCache implements LimitedCache {
|
||||||
Error(),
|
Error(),
|
||||||
'Cache key exists but size does not match. Deleting cache key.'
|
'Cache key exists but size does not match. Deleting cache key.'
|
||||||
);
|
);
|
||||||
unlink(cachePath);
|
unlink(cachePath).catch((e) => {
|
||||||
|
if (e.code === 'ENOENT') return;
|
||||||
|
logError(e, 'Failed to delete cache key');
|
||||||
|
});
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
DiskLRUService.touch(cachePath);
|
DiskLRUService.touch(cachePath);
|
||||||
|
@ -53,7 +56,10 @@ export class DiskCache implements LimitedCache {
|
||||||
Error(),
|
Error(),
|
||||||
'Old cache key exists but size does not match. Deleting cache key.'
|
'Old cache key exists but size does not match. Deleting cache key.'
|
||||||
);
|
);
|
||||||
unlink(oldCachePath);
|
unlink(oldCachePath).catch((e) => {
|
||||||
|
if (e.code === 'ENOENT') return;
|
||||||
|
logError(e, 'Failed to delete cache key');
|
||||||
|
});
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
const match = new Response(await getFileStream(oldCachePath));
|
const match = new Response(await getFileStream(oldCachePath));
|
||||||
|
|
Loading…
Add table
Reference in a new issue