Skip to content

Commit

Permalink
Pause will drop the current Sync and Normalize and hard-pause
Browse files Browse the repository at this point in the history
This is a more desired behavior when a user clicks pause
  • Loading branch information
iskakaushik committed Feb 29, 2024
1 parent 56b0dff commit 5fba427
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion flow/workflows/cdc_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -598,13 +598,21 @@ func CDCFlowWorkflow(
}

if restart {
if state.ActiveSignal == model.PauseSignal {
finished = true
}

for ctx.Err() == nil && (!finished || mainLoopSelector.HasPending()) {
mainLoopSelector.Select(ctx)
}

if err := ctx.Err(); err != nil {
w.logger.Info("mirror canceled", slog.Any("error", err))
return state, err
return nil, err
}

// important to control the size of inputs.
state.TruncateProgress(w.logger)
return state, workflow.NewContinueAsNewError(ctx, CDCFlowWorkflow, cfg, state)
}
}
Expand Down
2 changes: 1 addition & 1 deletion flow/workflows/sync_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

const (
maxSyncsPerSyncFlow = 72
maxSyncsPerSyncFlow = 36
)

func SyncFlowWorkflow(
Expand Down

0 comments on commit 5fba427

Please sign in to comment.