Skip to content

Commit

Permalink
fix: CloseNotifier deprecated in later version of Go
Browse files Browse the repository at this point in the history
Fix ported from PR:
afex#103

Author:
https://github.com/lpxxn
  • Loading branch information
uknth committed Oct 19, 2019
1 parent 28ca412 commit 1dbda09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion hystrix/eventstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (sh *StreamHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
events := sh.register(req)
defer sh.unregister(req)

notify := rw.(http.CloseNotifier).CloseNotify()
notify := req.Context().Done()

rw.Header().Add("Content-Type", "text/event-stream")
rw.Header().Set("Cache-Control", "no-cache")
Expand Down
2 changes: 1 addition & 1 deletion loadtest/service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func main() {
if err != nil {
log.Fatalf("could not initialize statsd client: %v", err)
}
metricCollector.Registry.Register(c.NewStatsdCollector)
metric.Registry.Register(c.NewStatsdCollector)

hystrix.ConfigureCommand("test", hystrix.CommandConfig{
Timeout: 50,
Expand Down

0 comments on commit 1dbda09

Please sign in to comment.