added timeouts to config
This commit is contained in:
@@ -43,3 +43,11 @@ csgowtfd:
|
||||
demos_expire: 30
|
||||
# ms between shots to count as spray
|
||||
spray_timeout: 500
|
||||
# timeouts
|
||||
timeout:
|
||||
# seconds before incoming request with no data send timeout
|
||||
read: 5
|
||||
# seconds to write a response before timeout
|
||||
write: 30
|
||||
# seconds before closing idle connections
|
||||
idle: 120
|
12
main.go
12
main.go
@@ -1152,9 +1152,9 @@ func main() {
|
||||
sockets = append(sockets, sL)
|
||||
go func() {
|
||||
srv := &http.Server{
|
||||
ReadTimeout: 5 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
IdleTimeout: 120 * time.Second,
|
||||
ReadTimeout: time.Duration(conf.Csgowtfd.Timeout.Read) * time.Second,
|
||||
WriteTimeout: time.Duration(conf.Csgowtfd.Timeout.Write) * time.Second,
|
||||
IdleTimeout: time.Duration(conf.Csgowtfd.Timeout.Idle) * time.Second,
|
||||
Handler: cors(proxyRouter),
|
||||
}
|
||||
_ = srv.Serve(sL)
|
||||
@@ -1167,9 +1167,9 @@ func main() {
|
||||
}
|
||||
go func() {
|
||||
srv := &http.Server{
|
||||
ReadTimeout: 5 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
IdleTimeout: 120 * time.Second,
|
||||
ReadTimeout: time.Duration(conf.Csgowtfd.Timeout.Read) * time.Second,
|
||||
WriteTimeout: time.Duration(conf.Csgowtfd.Timeout.Write) * time.Second,
|
||||
IdleTimeout: time.Duration(conf.Csgowtfd.Timeout.Idle) * time.Second,
|
||||
Handler: cors(proxyRouter),
|
||||
}
|
||||
err = srv.Serve(tL)
|
||||
|
@@ -64,6 +64,11 @@ type Conf struct {
|
||||
SharecodeUpdate string `yaml:"sharecode_update"`
|
||||
DemosExpire int `yaml:"demos_expire"`
|
||||
SprayTimeout int `yaml:"spray_timeout"`
|
||||
Timeout struct {
|
||||
Read int
|
||||
Write int
|
||||
Idle int
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user