add comment and refactor logging
This commit is contained in:
parent
2730fc99ca
commit
3c9556212f
1 changed files with 8 additions and 2 deletions
|
@ -56,8 +56,14 @@ class DiskLRUService {
|
|||
try {
|
||||
await unlink(leastRecentlyUsed.path);
|
||||
} catch (e) {
|
||||
if (e.code === 'ENOENT') return;
|
||||
logError(e, 'Failed to evict least recently used');
|
||||
// ENOENT: File not found
|
||||
// which can be ignored as we are trying to delete the file anyway
|
||||
if (e.code !== 'ENOENT') {
|
||||
logError(
|
||||
e,
|
||||
'Failed to evict least recently used'
|
||||
);
|
||||
}
|
||||
// ignoring the error, as it would get retried on the next run
|
||||
}
|
||||
this.evictLeastRecentlyUsed(cacheDir, maxSize);
|
||||
|
|
Loading…
Add table
Reference in a new issue