Skip to content

Commit

Permalink
Remove unnecessary hot loop
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
  • Loading branch information
sagikazarmark committed Aug 19, 2021
1 parent 5d96968 commit 1c0d7c9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions sd/etcd/client_test.go
Expand Up @@ -129,14 +129,12 @@ type fakeWatcher struct {
// When an event occurs it just return nil response and error.
// When an error occur it return a non nil error.
func (fw *fakeWatcher) Next(context.Context) (*etcd.Response, error) {
for {
select {
case <-fw.event:
return nil, nil
case <-fw.err:
return nil, errors.New("error from underlying etcd watcher")
select {
case <-fw.event:
return nil, nil
case <-fw.err:
return nil, errors.New("error from underlying etcd watcher")

}
}
}

Expand Down

0 comments on commit 1c0d7c9

Please sign in to comment.