mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-23 22:36:24 +00:00
Merge pull request #1917 from weaveworks/1916-dont-leak-goroutines
Timeout reads and writes in the http server.
This commit is contained in:
+6
-2
@@ -31,6 +31,7 @@ import (
|
||||
|
||||
const (
|
||||
memcacheUpdateInterval = 1 * time.Minute
|
||||
httpTimeout = 90 * time.Second
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -276,8 +277,11 @@ func appMain(flags appFlags) {
|
||||
// we want to manage the stop condition ourselves below
|
||||
NoSignalHandling: true,
|
||||
Server: &http.Server{
|
||||
Addr: flags.listen,
|
||||
Handler: handler,
|
||||
Addr: flags.listen,
|
||||
Handler: handler,
|
||||
ReadTimeout: httpTimeout,
|
||||
WriteTimeout: httpTimeout,
|
||||
MaxHeaderBytes: 1 << 20,
|
||||
},
|
||||
}
|
||||
go func() {
|
||||
|
||||
Reference in New Issue
Block a user