diff options
-rw-r--r-- | config.go | 3 | ||||
-rw-r--r-- | forge.scfg | 4 | ||||
-rw-r--r-- | main.go | 6 |
3 files changed, 10 insertions, 3 deletions
@@ -21,6 +21,9 @@ var config struct { Addr string `scfg:"addr"` CookieExpiry int `scfg:"cookie_expiry"` Root string `scfg:"root"` + ReadTimeout uint `scfg:"read_timeout"` + WriteTimeout uint `scfg:"write_timeout"` + IdleTimeout uint `scfg:"idle_timeout"` } `scfg:"http"` Hooks struct { Socket string `scfg:"socket"` @@ -13,6 +13,10 @@ http { # What is the canonical URL of the web root? root https://forge.example.org + + read_timeout 120 + write_timeout 120 + idle_timeout 120 } irc { @@ -89,9 +89,9 @@ func main() { } server := http.Server{ Handler: &forgeHTTPRouter{}, - ReadTimeout: 10 * time.Second, - WriteTimeout: 10 * time.Second, - IdleTimeout: 60 * time.Second, + ReadTimeout: time.Duration(config.HTTP.ReadTimeout) * time.Second, + WriteTimeout: time.Duration(config.HTTP.ReadTimeout) * time.Second, + IdleTimeout: time.Duration(config.HTTP.ReadTimeout) * time.Second, } //exhaustruct:ignore clog.Info("Listening HTTP on " + config.HTTP.Net + " " + config.HTTP.Addr) go func() { |