Skip to content

Commit

Permalink
Fix warning about issues with the cancel function. (#5397)
Browse files Browse the repository at this point in the history
The context created with context.WithCancel should be cancelled before
jumping to the START label.
  • Loading branch information
martinmr committed May 8, 2020
1 parent 025d14f commit 8db5e1f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions worker/groups.go
Expand Up @@ -787,6 +787,7 @@ START:
ctx, cancel := context.WithCancel(context.Background())
stream, err := c.StreamMembership(ctx, &api.Payload{})
if err != nil {
cancel()
glog.Errorf("Error while calling update %v\n", err)
time.Sleep(time.Second)
goto START
Expand Down

0 comments on commit 8db5e1f

Please sign in to comment.