Skip to content

Commit

Permalink
defer cancel in http calls (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
lanwen authored Apr 30, 2017
1 parent 7b2c4d3 commit a3a1543
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion selenoid/selenoid.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ func Status(ctx context.Context, baseUrl string) ([]byte, error) {
return nil, err
}

timedCtx, _ := context.WithTimeout(ctx, 1*time.Second)
timedCtx, cancel := context.WithTimeout(ctx, 1*time.Second)
defer cancel()

var state State
if err = httpDo(ctx, req.WithContext(timedCtx), func(resp *http.Response, err error) error {
Expand Down

0 comments on commit a3a1543

Please sign in to comment.