Skip to content

Commit

Permalink
don't signal normFlowFuture if normFlowFuture already done when sync …
Browse files Browse the repository at this point in the history
…flow finishes
  • Loading branch information
serprex committed Mar 5, 2024
1 parent 6f26120 commit 240b5e3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions flow/workflows/cdc_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,15 @@ func CDCFlowWorkflow(
logger.Info("sync finished, finishing normalize")
syncFlowFuture = nil
restart = true
err = model.NormalizeSignal.SignalChildWorkflow(ctx, normFlowFuture, model.NormalizePayload{
Done: true,
SyncBatchID: -1,
}).Get(ctx, nil)
if err != nil {
logger.Warn("failed to signal normalize done, finishing", slog.Any("error", err))
finished = true
if normFlowFuture != nil {
err = model.NormalizeSignal.SignalChildWorkflow(ctx, normFlowFuture, model.NormalizePayload{
Done: true,
SyncBatchID: -1,
}).Get(ctx, nil)
if err != nil {
logger.Warn("failed to signal normalize done, finishing", slog.Any("error", err))
finished = true
}
}
})
mainLoopSelector.AddFuture(normFlowFuture, func(f workflow.Future) {
Expand Down

0 comments on commit 240b5e3

Please sign in to comment.