fix issue

This commit is contained in:
Abhinav 2024-01-11 09:50:11 +05:30
parent 9862a09786
commit 218b6214ce

View file

@ -53,11 +53,12 @@ class DiskLRUService {
if (size >= maxSize) {
const leastRecentlyUsed =
await this.findLeastRecentlyUsed(cacheDir);
await unlink(leastRecentlyUsed.path).catch((e) => {
try {
await unlink(leastRecentlyUsed.path);
} catch (e) {
if (e.code === 'ENOENT') return;
logError(e, 'Failed to evict least recently used');
});
}
this.evictLeastRecentlyUsed(cacheDir, maxSize);
}
resolve(null);