Skip to content

Commit

Permalink
quick hack to prevent indefinite buildup of closenotify routines
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jeromy <[email protected]>
  • Loading branch information
whyrusleeping committed Nov 28, 2015
1 parent e04a31d commit ac5acc2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions commands/http/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ func (i internalHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if cn, ok := w.(http.CloseNotifier); ok {
go func() {
select {
case <-time.After(time.Minute * 30):
// TODO: this is a hack to avoid these goroutines building up in memory
log.Warning("TODO: close notify needs to be fixed")
case <-cn.CloseNotify():
case <-ctx.Done():
}
Expand Down

0 comments on commit ac5acc2

Please sign in to comment.