Skip to content

Commit

Permalink
Handle case context is done
Browse files Browse the repository at this point in the history
  • Loading branch information
abicky committed Oct 30, 2024
1 parent 63f719c commit 71610e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/capacity/autoscalinggroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ func (asg *AutoScalingGroup) waitUntilInstancesInService(ctx context.Context, ca
continue
case <-timer.C:
return xerrors.Errorf("can't prepare at least %d in-service instances within %v", capacity, timeout)
case <-ctx.Done():
return ctx.Err()
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions internal/capacity/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ func (c *cluster) WaitUntilContainerInstancesRegistered(ctx context.Context, cou
continue
case <-timer.C:
return xerrors.Errorf("%d container instances expected to be registered but only %d instances were registered within %v", count, foundCount, timeout)
case <-ctx.Done():
return ctx.Err()
}
}
}

0 comments on commit 71610e3

Please sign in to comment.