From 208fecedc7c2a2b63d6e78d4892587669339087c Mon Sep 17 00:00:00 2001 From: David Galey Date: Tue, 2 Dec 2025 12:40:21 -0500 Subject: [PATCH] shorten incremental sync if it is too long --- digicert-certcentral-caplugin/CertCentralCAPlugin.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/digicert-certcentral-caplugin/CertCentralCAPlugin.cs b/digicert-certcentral-caplugin/CertCentralCAPlugin.cs index 69820c2..c2fdb76 100644 --- a/digicert-certcentral-caplugin/CertCentralCAPlugin.cs +++ b/digicert-certcentral-caplugin/CertCentralCAPlugin.cs @@ -764,6 +764,10 @@ public async Task Synchronize(BlockingCollection blockin // If no last sync, use a 6 day window for the sync range (only relevant for incremental syncs) lastSync = lastSync.HasValue ? lastSync.Value.AddHours(-7) : DateTime.UtcNow.AddDays(-5); DateTime? utcDate = DateTime.UtcNow.AddDays(1); + if ((utcDate.Value - lastSync.Value).Days > 6) + { + lastSync = DateTime.UtcNow.AddDays(-5); + } string lastSyncFormat = FormatSyncDate(lastSync); string todaySyncFormat = FormatSyncDate(utcDate);