Refactored all synchronizers to deal with some of the chronic issues.

This commit is contained in:
Burak Kaan Köse
2026-02-06 01:18:12 +01:00
parent d1425ca9ca
commit 071f1c9786
43 changed files with 2785 additions and 582 deletions
+20
View File
@@ -599,4 +599,24 @@ public class AccountService : BaseDatabaseService, IAccountService
return account?.Preferences?.IsNotificationsEnabled ?? false;
}
public async Task UpdateLastFolderStructureSyncDateAsync(Guid accountId)
{
var account = await GetAccountAsync(accountId);
if (account == null) return;
account.LastFolderStructureSyncDate = DateTime.UtcNow;
await Connection.UpdateAsync(account, typeof(MailAccount)).ConfigureAwait(false);
}
public async Task<bool> ShouldSyncFolderStructureAsync(Guid accountId, TimeSpan syncInterval)
{
var account = await GetAccountAsync(accountId);
if (account == null) return true;
if (!account.LastFolderStructureSyncDate.HasValue)
return true;
return DateTime.UtcNow - account.LastFolderStructureSyncDate.Value > syncInterval;
}
}