1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-16 00:03:22 +00:00

Incremental sync only every 30 minutes

This commit is contained in:
Kyle Spearrin
2016-07-28 21:41:45 -04:00
parent bb4b732b76
commit 7b76f2c238
3 changed files with 15 additions and 2 deletions

View File

@@ -167,6 +167,17 @@ namespace Bit.App.Services
return true;
}
public async Task<bool> IncrementalSyncAsync(TimeSpan syncThreshold)
{
DateTime? lastSync = _settings.GetValueOrDefault<DateTime?>(LastSyncKey);
if(lastSync != null && DateTime.UtcNow - lastSync.Value < syncThreshold)
{
return false;
}
return await IncrementalSyncAsync();
}
public async Task<bool> IncrementalSyncAsync()
{
if(!_authService.IsAuthenticated)