Skip to content

Commit

Permalink
[dropflow] delete flow configs only after finish drop (#2281)
Browse files Browse the repository at this point in the history
  • Loading branch information
heavycrystal authored Nov 22, 2024
1 parent 60c2744 commit cf14792
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions flow/workflows/drop_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ func DropFlowWorkflow(ctx workflow.Context, input *protos.DropFlowInput) error {
}
}

if input.FlowConnectionConfigs != nil {
err := executeCDCDropActivities(ctx, input)
if err != nil {
workflow.GetLogger(ctx).Error("failed to drop CDC flow", slog.Any("error", err))
return err
}
workflow.GetLogger(ctx).Info("CDC flow dropped successfully")
}

removeFlowEntriesCtx := workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
StartToCloseTimeout: 1 * time.Minute,
})
Expand All @@ -103,14 +112,5 @@ func DropFlowWorkflow(ctx workflow.Context, input *protos.DropFlowInput) error {
return err
}

if input.FlowConnectionConfigs != nil {
err := executeCDCDropActivities(ctx, input)
if err != nil {
workflow.GetLogger(ctx).Error("failed to drop CDC flow", slog.Any("error", err))
return err
}
workflow.GetLogger(ctx).Info("CDC flow dropped successfully")
}

return nil
}

0 comments on commit cf14792

Please sign in to comment.