Skip to content

Commit

Permalink
replace timer with ticker
Browse files Browse the repository at this point in the history
  • Loading branch information
bachmanity1 committed Sep 3, 2024
1 parent 856ab73 commit 9772a31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions e2e/topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ func (s *Service) validateManagementTopic(ctx context.Context) error {
// The partition count must be updated after topic validation because the validation process may lead to the
// creation of new partitions. This can occur when new brokers are added to the cluster.
func (s *Service) updatePartitionCount(ctx context.Context) error {
for {
timer := time.NewTimer(1 * time.Second)
defer timer.Stop()
retryTicker := time.NewTicker(1 * time.Second)
defer retryTicker.Stop()

for {
select {
case <-ctx.Done():
return ctx.Err()
case <-timer.C:
case <-retryTicker.C:
meta, err := s.getTopicMetadata(ctx)
if err != nil {
return fmt.Errorf("could not get topic metadata while updating partition count: %w", err)
Expand Down

0 comments on commit 9772a31

Please sign in to comment.