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
4
main.go
4
main.go
|
|
@ -156,6 +156,10 @@ func main() {
|
||||||
server := &http.Server{
|
server := &http.Server{
|
||||||
Addr: config.Bind,
|
Addr: config.Bind,
|
||||||
Handler: r,
|
Handler: r,
|
||||||
|
ReadTimeout: 10 * time.Second,
|
||||||
|
WriteTimeout: 30 * time.Second,
|
||||||
|
IdleTimeout: 120 * time.Second,
|
||||||
|
ReadHeaderTimeout: 5 * time.Second,
|
||||||
}
|
}
|
||||||
if config.IsProductionEnvironment() {
|
if config.IsProductionEnvironment() {
|
||||||
listeners, _ := activation.Listeners()
|
listeners, _ := activation.Listeners()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue