Skip to content

Commit

Permalink
don't wait 10 minutes when slot still in use
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Jan 9, 2025
1 parent 980eb42 commit 8d6244a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions flow/workflows/cdc_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,15 @@ func CDCFlowWorkflow(
} else {
logger.Error("error in sync flow", slog.Any("error", err))
}
logger.Info("sync flow errored, sleeping for 10 minutes before retrying")
_ = workflow.Sleep(ctx, 10*time.Minute)

// cannot use shared.IsSQLStateError because temporal serialize/deserialize
if strings.Contains(err.Error(), "(SQLSTATE 55006)") {
logger.Info("sync flow errored, sleeping for 1 minute before retrying")
_ = workflow.Sleep(ctx, time.Minute)
} else {
logger.Info("sync flow errored, sleeping for 10 minutes before retrying")
_ = workflow.Sleep(ctx, 10*time.Minute)
}
} else {
logger.Info("sync finished")
}
Expand Down

0 comments on commit 8d6244a

Please sign in to comment.