Skip to content

Commit

Permalink
fix up syncErr handling
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Feb 28, 2024
1 parent 1e408f1 commit 81b0259
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions flow/workflows/sync_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ func SyncFlowWorkflow(
err.Error(),
).Get(ctx, nil)
syncErr = true
mustWait = false
} else if childSyncFlowRes != nil {
_ = model.SyncResultSignal.SignalExternalWorkflow(
ctx,
Expand Down Expand Up @@ -180,15 +179,15 @@ func SyncFlowWorkflow(
}
})

for ctx.Err() == nil && (!syncDone || selector.HasPending()) {
for ctx.Err() == nil && (syncErr || !syncDone || selector.HasPending()) {
selector.Select(ctx)
}
if ctx.Err() != nil {
break
}

restart := currentSyncFlowNum >= maxSyncsPerSyncFlow || syncErr
if !stop && mustWait {
if !stop && !syncErr && mustWait {
waitSelector.Select(ctx)
if restart {
// must flush selector for signals received while waiting
Expand Down

0 comments on commit 81b0259

Please sign in to comment.