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:
Eli Ribble 2026-05-19 00:00:49 +00:00
parent e93c88003e
commit 05fc763b2f
No known key found for this signature in database

View file

@ -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()