TF-4274 Make folder deletions best-effort for both paths.

This commit is contained in:
dab246
2026-01-29 10:43:57 +07:00
committed by Dat H. Pham
parent 4b3a0692a9
commit 8fc5affb36
+10 -8
View File
@@ -121,7 +121,7 @@ class CachingManager {
clearDetailedEmailCache(),
]);
} catch (e) {
logWarning('CachingManager::_clearEmailAndStateCache: Cannot clear email and state cache: $e');
logWarning('CachingManager::clearAllEmailAndStateCache: Cannot clear email and state cache: $e');
}
}
@@ -139,12 +139,14 @@ class CachingManager {
Future<void> _clearEmailContentFileInStorage() async {
try {
await _fileUtils.removeFolder(
CachingConstants.openedEmailContentFolderName,
);
await _fileUtils.removeFolder(
CachingConstants.newEmailsContentFolderName,
);
await Future.wait([
_fileUtils.removeFolder(
CachingConstants.openedEmailContentFolderName,
),
_fileUtils.removeFolder(
CachingConstants.newEmailsContentFolderName,
),
]);
} catch (e) {
logWarning(
'CachingManager::_clearEmailContentFileInStorage: Cannot clear file in storage: $e',
@@ -167,7 +169,7 @@ class CachingManager {
_stateCacheManager.clear(),
], eagerError: true);
} catch (e) {
logWarning('CachingManager::clearMailboxCache: Cannot clear mailbox cache: $e');
logWarning('CachingManager::clearMailboxAndStateCache: Cannot clear mailbox cache: $e');
}
}