Skip to content

Commit

Permalink
change logic to ignore pending updates and signals if d.done
Browse files Browse the repository at this point in the history
  • Loading branch information
carlydf committed Jan 31, 2025
1 parent fc965a0 commit 6952be3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion service/worker/workerdeployment/version_workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (d *VersionWorkflowRunner) run(ctx workflow.Context) error {
workflow.Go(ctx, d.listenToSignals)

// Wait on any pending signals and updates.
err := workflow.Await(ctx, func() bool { return (d.signalsCompleted || d.done) && d.pendingUpdates == 0 })
err := workflow.Await(ctx, func() bool { return (d.signalsCompleted && d.pendingUpdates == 0) || d.done })
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion service/worker/workerdeployment/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (d *WorkflowRunner) run(ctx workflow.Context) error {

// Wait until we can continue as new or are cancelled.
err = workflow.Await(ctx, func() bool {
return (workflow.GetInfo(ctx).GetContinueAsNewSuggested() || d.done) && pendingUpdates == 0
return (workflow.GetInfo(ctx).GetContinueAsNewSuggested() && pendingUpdates == 0) || d.done
})
if err != nil {
return err
Expand Down

0 comments on commit 6952be3

Please sign in to comment.