From f713c2f060c170cfff4dc85d384ad01b4ad128db Mon Sep 17 00:00:00 2001 From: Paul Irwin Date: Thu, 31 Jul 2025 16:22:35 -0600 Subject: [PATCH] Add RecordCount support on sync results/log --- Syncerbell/SyncResult.cs | 5 +++-- Syncerbell/SyncService.cs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Syncerbell/SyncResult.cs b/Syncerbell/SyncResult.cs index 75815a8..0c82da8 100644 --- a/Syncerbell/SyncResult.cs +++ b/Syncerbell/SyncResult.cs @@ -1,10 +1,11 @@ namespace Syncerbell; /// -/// Represents the result of a synchronization operation, including entity, status, message, and high-water mark. +/// Represents the result of a synchronization operation, including entity, status, message, high-water mark, and record count. /// /// The entity options associated with the sync operation. /// Indicates whether the sync operation was successful. /// An optional message describing the result of the sync operation. /// An optional high-water mark value for incremental sync scenarios. -public record SyncResult(SyncEntityOptions Entity, bool Success, string? Message = null, string? HighWaterMark = null); +/// An optional count of records processed during the sync operation. +public record SyncResult(SyncEntityOptions Entity, bool Success, string? Message = null, string? HighWaterMark = null, int? RecordCount = null); diff --git a/Syncerbell/SyncService.cs b/Syncerbell/SyncService.cs index c14b2d8..72e2080 100644 --- a/Syncerbell/SyncService.cs +++ b/Syncerbell/SyncService.cs @@ -194,6 +194,7 @@ private async Task UpdateLogEntry(ISyncLogEntry log, SyncStatus status, SyncResu log.ResultMessage = syncResult.Message ?? (syncResult.Success ? SyncSuccessMessage : SyncFailedMessage); log.FinishedAt = DateTime.UtcNow; log.HighWaterMark = syncResult.HighWaterMark; + log.RecordCount = syncResult.RecordCount; await syncLogPersistence.UpdateLogEntry(log, cancellationToken); } }