Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7ccbcb0

Browse files
bachmanity1weeco
authored andcommittedNov 3, 2024
replace timer with ticker
1 parent 093a5f9 commit 7ccbcb0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎e2e/topic.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ func (s *Service) validateManagementTopic(ctx context.Context) error {
7575
// The partition count must be updated after topic validation because the validation process may lead to the
7676
// creation of new partitions. This can occur when new brokers are added to the cluster.
7777
func (s *Service) updatePartitionCount(ctx context.Context) error {
78-
for {
79-
timer := time.NewTimer(1 * time.Second)
80-
defer timer.Stop()
78+
retryTicker := time.NewTicker(1 * time.Second)
79+
defer retryTicker.Stop()
8180

81+
for {
8282
select {
8383
case <-ctx.Done():
8484
return ctx.Err()
85-
case <-timer.C:
85+
case <-retryTicker.C:
8686
meta, err := s.getTopicMetadata(ctx)
8787
if err != nil {
8888
return fmt.Errorf("could not get topic metadata while updating partition count: %w", err)

0 commit comments

Comments
 (0)
Please sign in to comment.