Skip to content

Commit cd8fd90

Browse files
committed
change default start sync date for first incremental sync
1 parent a4dfbe2 commit cd8fd90

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

digicert-certcentral-caplugin/CertCentralCAPlugin.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,9 @@ public async Task Synchronize(BlockingCollection<AnyCAPluginCertificate> blockin
760760
{
761761
_logger.MethodEntry(LogLevel.Trace);
762762

763-
lastSync = lastSync.HasValue ? lastSync.Value.AddHours(-7) : DateTime.MinValue; // DigiCert issue with treating the timezone as mountain time. -7 to accomodate DST
763+
// DigiCert issue with treating the timezone as mountain time. -7 hours to accomodate DST
764+
// If no last sync, use 7 days in the past as the starting point (only relevant for incremental syncs)
765+
lastSync = lastSync.HasValue ? lastSync.Value.AddHours(-7) : DateTime.UtcNow.AddDays(-7);
764766
DateTime? utcDate = DateTime.UtcNow.AddDays(1);
765767
string lastSyncFormat = FormatSyncDate(lastSync);
766768
string todaySyncFormat = FormatSyncDate(utcDate);

0 commit comments

Comments
 (0)