Skip to content

Commit

Permalink
MaintainPull: disable retries
Browse files Browse the repository at this point in the history
When MaintainPull fails the sync flow should be restarted
  • Loading branch information
serprex committed Feb 28, 2024
1 parent 96ca628 commit 1e408f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flow/activities/flowable.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (a *FlowableActivity) MaintainPull(
a.CdcCacheRw.Lock()
delete(a.CdcCache, sessionID)
a.CdcCacheRw.Unlock()
return err
return temporal.NewNonRetryableApplicationError("connection to source down", "disconnect", err)
}
case <-ctx.Done():
a.CdcCacheRw.Lock()
Expand Down
4 changes: 2 additions & 2 deletions flow/workflows/sync_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ func SyncFlowWorkflow(
defer workflow.CompleteSession(syncSessionCtx)
sessionInfo := workflow.GetSessionInfo(syncSessionCtx)

syncCtx := workflow.WithActivityOptions(syncSessionCtx, workflow.ActivityOptions{
maintainCtx := workflow.WithActivityOptions(syncSessionCtx, workflow.ActivityOptions{
StartToCloseTimeout: 14 * 24 * time.Hour,
HeartbeatTimeout: time.Minute,
WaitForCancellation: true,
})
fMaintain := workflow.ExecuteActivity(
syncCtx,
maintainCtx,
flowable.MaintainPull,
config,
sessionInfo.SessionID,
Expand Down

0 comments on commit 1e408f1

Please sign in to comment.