15 seconds was no way long enough for long running api calls
This commit is contained in:
parent
fabbb6a52c
commit
1dba36f9f5
10
server.go
10
server.go
|
@ -147,11 +147,11 @@ func (s *server) ServeTLS(keyPath string, certPath string) error {
|
||||||
Handler: s.router,
|
Handler: s.router,
|
||||||
Addr: s.address,
|
Addr: s.address,
|
||||||
// Good practice: enforce timeouts for servers you create!
|
// Good practice: enforce timeouts for servers you create!
|
||||||
WriteTimeout: 15 * time.Second,
|
WriteTimeout: 120 * time.Second,
|
||||||
ReadTimeout: 15 * time.Second,
|
ReadTimeout: 120 * time.Second,
|
||||||
}
|
}
|
||||||
|
|
||||||
return srv.ListenAndServeTLS(keyPath, certPath)
|
return srv.ListenAndServeTLS(certPath,keyPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Serve serve content forever
|
// Serve serve content forever
|
||||||
|
@ -160,8 +160,8 @@ func (s *server) Serve() error {
|
||||||
Handler: s.router,
|
Handler: s.router,
|
||||||
Addr: s.address,
|
Addr: s.address,
|
||||||
// Good practice: enforce timeouts for servers you create!
|
// Good practice: enforce timeouts for servers you create!
|
||||||
WriteTimeout: 15 * time.Second,
|
WriteTimeout: 120 * time.Second,
|
||||||
ReadTimeout: 15 * time.Second,
|
ReadTimeout: 120 * time.Second,
|
||||||
}
|
}
|
||||||
|
|
||||||
return srv.ListenAndServe()
|
return srv.ListenAndServe()
|
||||||
|
|
Loading…
Reference in New Issue