Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

add comment and refactor logging

Abhinav3c9556212fde
diff --git a/src/services/diskLRU.ts b/src/services/diskLRU.ts
index 6e42c690ac..56f0e9593c 100644
--- a/src/services/diskLRU.ts
+++ b/src/services/diskLRU.ts
@@ -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);