refactor(datasync): use WithUpdateType instead of WithMode in TableSyncOperation
Update TableSyncOperation to pass UpdateTypes directly to the pipeline builder using WithUpdateType() instead of mapping to SyncMode and calling the deprecated WithMode() method. This enables proper schedule-based configuration handling where Daily and Hourly have distinct behaviors. - Remove SyncMode mapping logic from ExecuteSyncCoreAsync - Call WithUpdateType(task.UpdateType) directly - Update log message to reflect UpdateType instead of SyncMode - Add TableSyncOperationTests verifying WithUpdateType is called correctly
This commit is contained in:
@@ -133,15 +133,12 @@ public class TableSyncOperation : ITableSyncOperation
|
||||
/// </summary>
|
||||
private async Task<long> ExecuteSyncCoreAsync(DataUpdateTask task, CancellationToken cancellationToken)
|
||||
{
|
||||
// Determine sync mode based on update type
|
||||
var syncMode = task.UpdateType == UpdateTypes.Mass ? SyncMode.Mass : SyncMode.Incremental;
|
||||
_logger.LogDebug("Building pipeline for {Table} with UpdateType={UpdateType}", task.TableName, task.UpdateType);
|
||||
|
||||
_logger.LogDebug("Building pipeline for {Table} in {Mode} mode", task.TableName, syncMode);
|
||||
|
||||
// Build and execute the pipeline
|
||||
// Build and execute the pipeline using the task's UpdateType directly
|
||||
var pipeline = _pipelineFactory
|
||||
.ForTable(task.TableName)
|
||||
.WithMode(syncMode)
|
||||
.WithUpdateType(task.UpdateType)
|
||||
.WithMinimumDate(task.MinimumDt)
|
||||
.Build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user