Remove closeBox when open box in hive database
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -56,12 +56,16 @@ extension EmailCacheExtension on EmailCache {
|
||||
|
||||
bool expireTimeCaching(EmailCleanupRule cleanupRule) {
|
||||
final currentTime = DateTime.now();
|
||||
log('EmailCacheExtension::expireTimeCaching():currentTime: $currentTime | receivedAt: $receivedAt');
|
||||
if (receivedAt != null) {
|
||||
final countDay = currentTime.daysBetween(receivedAt!.toLocal());
|
||||
log('EmailCacheExtension::expireTimeCaching():countDay: $countDay | cleanupRule.cachingEmailPeriod.countDay: ${cleanupRule.cachingEmailPeriod.countDay}');
|
||||
if (countDay >= cleanupRule.cachingEmailPeriod.countDay) {
|
||||
log('EmailCacheExtension::expireTimeCaching():true');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
log('EmailCacheExtension::expireTimeCaching():false');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ class EmailCacheManager {
|
||||
|
||||
Future<EmailCache> getStoredEmail(AccountId accountId, UserName userName, EmailId emailId) async {
|
||||
final keyCache = TupleKey(emailId.asString, accountId.asString, userName.value).encodeKey;
|
||||
final emailCache = await _emailCacheClient.getItem(keyCache, needToReopen: true);
|
||||
final emailCache = await _emailCacheClient.getItem(keyCache);
|
||||
if (emailCache != null) {
|
||||
return emailCache;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user