Skip to content

Commit

Permalink
rename timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanos committed Oct 2, 2024
1 parent 7c726e9 commit 509449f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions early-return/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const (
)

var (
activityTimeout = 2 * time.Second
updateTimeout = 5 * time.Second
activityTimeout = 2 * time.Second
earlyReturnTimeout = 5 * time.Second
)

// Workflow processes a transaction in two phases. First, the transaction is initialized, and if successful,
Expand All @@ -35,7 +35,7 @@ func Workflow(ctx workflow.Context, transactionId, fromAccount, toAccount string
UpdateName,
func(ctx workflow.Context) error {
condition := func() bool { return initDone }
if completed, err := workflow.AwaitWithTimeout(ctx, updateTimeout, condition); err != nil {
if completed, err := workflow.AwaitWithTimeout(ctx, earlyReturnTimeout, condition); err != nil {
return fmt.Errorf("update cancelled: %w", err)
} else if !completed {
return errors.New("update timed out")
Expand Down

0 comments on commit 509449f

Please sign in to comment.