Add a set of basic timeouts to the HTTP server
This is a basic step in figuring out our hung requests problem
This commit is contained in:
parent
e93c88003e
commit
05fc763b2f
1 changed files with 6 additions and 2 deletions
8
main.go
8
main.go
|
|
@ -154,8 +154,12 @@ func main() {
|
|||
os.Exit(8)
|
||||
}
|
||||
server := &http.Server{
|
||||
Addr: config.Bind,
|
||||
Handler: r,
|
||||
Addr: config.Bind,
|
||||
Handler: r,
|
||||
ReadTimeout: 10 * time.Second,
|
||||
WriteTimeout: 30 * time.Second,
|
||||
IdleTimeout: 120 * time.Second,
|
||||
ReadHeaderTimeout: 5 * time.Second,
|
||||
}
|
||||
if config.IsProductionEnvironment() {
|
||||
listeners, _ := activation.Listeners()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue