Skip to content

Commit

Permalink
fix(sdk): no more ctx.Err() in queue polling (#3425)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsamin authored and richardlt committed Oct 9, 2018
1 parent 5df9047 commit 064bcc9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sdk/cdsclient/http_sse.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ func (c *client) RequestSSEGet(ctx context.Context, path string, evCh chan<- SSE
var currEvent *SSEvent
var EOF bool

for !EOF {
if ctx.Err() != nil {
break
}
go func(stop *bool) {
<-ctx.Done()
*stop = true
}(&EOF)

for !EOF {
bs, err := br.ReadBytes('\n')

if err != nil && err != io.EOF {
return err
}
Expand Down

0 comments on commit 064bcc9

Please sign in to comment.