Skip to content

Commit 208fece

Browse files
committed
shorten incremental sync if it is too long
1 parent a64934c commit 208fece

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

digicert-certcentral-caplugin/CertCentralCAPlugin.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,10 @@ public async Task Synchronize(BlockingCollection<AnyCAPluginCertificate> blockin
764764
// If no last sync, use a 6 day window for the sync range (only relevant for incremental syncs)
765765
lastSync = lastSync.HasValue ? lastSync.Value.AddHours(-7) : DateTime.UtcNow.AddDays(-5);
766766
DateTime? utcDate = DateTime.UtcNow.AddDays(1);
767+
if ((utcDate.Value - lastSync.Value).Days > 6)
768+
{
769+
lastSync = DateTime.UtcNow.AddDays(-5);
770+
}
767771
string lastSyncFormat = FormatSyncDate(lastSync);
768772
string todaySyncFormat = FormatSyncDate(utcDate);
769773

0 commit comments

Comments
 (0)