Skip to content

Commit

Permalink
don't call getMaxSyncsPerCDCFlow in loop
Browse files Browse the repository at this point in the history
this was spamming temporal history
  • Loading branch information
serprex committed Jun 22, 2024
1 parent 38dd81f commit d811bd0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flow/workflows/cdc_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ func CDCFlowWorkflow(
addCdcPropertiesSignalListener(ctx, logger, mainLoopSelector, state)

state.CurrentFlowStatus = protos.FlowStatus_STATUS_RUNNING
maxSyncPerCDCFlow := int(getMaxSyncsPerCDCFlow(ctx, logger))
for {
mainLoopSelector.Select(ctx)
for ctx.Err() == nil && mainLoopSelector.HasPending() {
Expand All @@ -531,7 +532,7 @@ func CDCFlowWorkflow(
return state, err
}

if state.ActiveSignal == model.PauseSignal || syncCount >= int(getMaxSyncsPerCDCFlow(ctx, logger)) {
if state.ActiveSignal == model.PauseSignal || syncCount >= maxSyncPerCDCFlow {
restart = true
if syncFlowFuture != nil {
err := model.SyncStopSignal.SignalChildWorkflow(ctx, syncFlowFuture, struct{}{}).Get(ctx, nil)
Expand Down

0 comments on commit d811bd0

Please sign in to comment.