lets-go:10.6 timeouts
This commit is contained in:
parent
5d582a5971
commit
7479313ee8
@ -73,10 +73,13 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
srv := &http.Server{
|
srv := &http.Server{
|
||||||
Addr: *addr,
|
Addr: *addr,
|
||||||
Handler: app.routes(),
|
Handler: app.routes(),
|
||||||
ErrorLog: slog.NewLogLogger(logger.Handler(), slog.LevelError),
|
ErrorLog: slog.NewLogLogger(logger.Handler(), slog.LevelError),
|
||||||
TLSConfig: tlsConfig,
|
TLSConfig: tlsConfig,
|
||||||
|
IdleTimeout: time.Minute,
|
||||||
|
ReadTimeout: 5 * time.Second,
|
||||||
|
WriteTimeout: 10 * time.Second,
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.Info("starting server", slog.String("addr", srv.Addr))
|
logger.Info("starting server", slog.String("addr", srv.Addr))
|
||||||
|
Loading…
Reference in New Issue
Block a user