1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

chore: configurable request timeout

This commit is contained in:
Ferdinand Mütsch
2021-06-24 21:56:47 +02:00
parent c3957ec0c8
commit 4d2a160ccb
5 changed files with 10 additions and 7 deletions

12
main.go
View File

@@ -250,8 +250,8 @@ func listen(handler http.Handler) {
s4 = &http.Server{
Handler: handler,
Addr: bindString4,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
ReadTimeout: time.Duration(config.Server.TimeoutSec) * time.Second,
WriteTimeout: time.Duration(config.Server.TimeoutSec) * time.Second,
}
}
@@ -261,8 +261,8 @@ func listen(handler http.Handler) {
s6 = &http.Server{
Handler: handler,
Addr: bindString6,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
ReadTimeout: time.Duration(config.Server.TimeoutSec) * time.Second,
WriteTimeout: time.Duration(config.Server.TimeoutSec) * time.Second,
}
}
@@ -270,8 +270,8 @@ func listen(handler http.Handler) {
if config.Server.ListenSocket != "" {
sSocket = &http.Server{
Handler: handler,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
ReadTimeout: time.Duration(config.Server.TimeoutSec) * time.Second,
WriteTimeout: time.Duration(config.Server.TimeoutSec) * time.Second,
}
}