diff options
author | Vladimir Shushlin <vshushlin@gitlab.com> | 2022-04-13 08:00:41 +0300 |
---|---|---|
committer | Vladimir Shushlin <vshushlin@gitlab.com> | 2022-04-13 08:00:41 +0300 |
commit | 5557bad5e66a8ee19f456f067c8425558c4af8c7 (patch) | |
tree | ce03192234dae5d34dba243e5b2222cb599e6d89 | |
parent | 43432cc9aad59e9a5aab56d15774e39765c17c2c (diff) | |
parent | df9c7c413e35940feb7b1ea3664cb6f6e03814a3 (diff) |
Merge branch 'kassio/fix-large-file-download-timeouts-1-51' into '1-51-stable'
Increase serverWriteTimeout to avoid errors with large files
See merge request gitlab-org/gitlab-pages!723
-rw-r--r-- | internal/config/config.go | 4 | ||||
-rw-r--r-- | internal/config/flags.go | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index f689524c..2f8fa089 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -333,6 +333,10 @@ func LogConfig(config *Config) { "zip-cache-cleanup": config.Zip.CleanupInterval, "zip-cache-refresh": config.Zip.RefreshInterval, "zip-open-timeout": config.Zip.OpenTimeout, + "server-read-timeout": config.Server.ReadTimeout, + "server-read-header-timeout": config.Server.ReadHeaderTimeout, + "server-write-timeout": config.Server.WriteTimeout, + "server-keep-alive": config.Server.ListenKeepAlive, }).Debug("Start Pages with configuration") } diff --git a/internal/config/flags.go b/internal/config/flags.go index d78c043e..61fd13b8 100644 --- a/internal/config/flags.go +++ b/internal/config/flags.go @@ -65,7 +65,7 @@ var ( // HTTP server timeouts serverReadTimeout = flag.Duration("server-read-timeout", 5*time.Second, "ReadTimeout is the maximum duration for reading the entire request, including the body. A zero or negative value means there will be no timeout.") serverReadHeaderTimeout = flag.Duration("server-read-header-timeout", time.Second, "ReadHeaderTimeout is the amount of time allowed to read request headers. A zero or negative value means there will be no timeout.") - serverWriteTimeout = flag.Duration("server-write-timeout", 30*time.Second, "WriteTimeout is the maximum duration before timing out writes of the response. A zero or negative value means there will be no timeout.") + serverWriteTimeout = flag.Duration("server-write-timeout", 5*time.Minute, "WriteTimeout is the maximum duration before timing out writes of the response. A zero or negative value means there will be no timeout.") serverKeepAlive = flag.Duration("server-keep-alive", 15*time.Second, "KeepAlive specifies the keep-alive period for network connections accepted by this listener. If zero, keep-alives are enabled if supported by the protocol and operating system. If negative, keep-alives are disabled.") disableCrossOriginRequests = flag.Bool("disable-cross-origin-requests", false, "Disable cross-origin requests") |