Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHüseyin Emre Aksoy <h.emreaksoy@hotmail.com>2022-03-04 08:38:51 +0300
committerJaime Martinez <jmartinez@gitlab.com>2022-03-04 08:38:51 +0300
commitf78d8d18b960f66a2a4f4e2044e2159647d375af (patch)
treea7cb756574da0e5a013683da9ea6705cf3f4db1e /internal
parenta2edfcd0253bfc9aaf796fb0531e4e5f5c9a4adf (diff)
feat: make server shutdown timeout configurable
Changelog: added
Diffstat (limited to 'internal')
-rw-r--r--internal/config/config.go20
-rw-r--r--internal/config/flags.go1
2 files changed, 12 insertions, 9 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 24a811ec..cef23be8 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -35,15 +35,16 @@ type Config struct {
// General groups settings that are general to GitLab Pages and can not
// be categorized under other head.
type General struct {
- Domain string
- MaxConns int
- MaxURILength int
- MetricsAddress string
- RedirectHTTP bool
- RootCertificate []byte
- RootDir string
- RootKey []byte
- StatusPath string
+ Domain string
+ MaxConns int
+ MaxURILength int
+ MetricsAddress string
+ RedirectHTTP bool
+ RootCertificate []byte
+ RootDir string
+ RootKey []byte
+ ServerShutdownTimeout time.Duration
+ StatusPath string
DisableCrossOriginRequests bool
InsecureCiphers bool
@@ -177,6 +178,7 @@ func loadConfig() (*Config, error) {
RedirectHTTP: *redirectHTTP,
RootDir: *pagesRoot,
StatusPath: *pagesStatus,
+ ServerShutdownTimeout: *serverShutdownTimeout,
DisableCrossOriginRequests: *disableCrossOriginRequests,
InsecureCiphers: *insecureCiphers,
PropagateCorrelationID: *propagateCorrelationID,
diff --git a/internal/config/flags.go b/internal/config/flags.go
index 409ecdc7..5ddc7df6 100644
--- a/internal/config/flags.go
+++ b/internal/config/flags.go
@@ -47,6 +47,7 @@ var (
_ = flag.Bool("daemon-enable-jail", false, "DEPRECATED and ignored, will be removed in 15.0")
_ = flag.Bool("daemon-inplace-chroot", false, "DEPRECATED and ignored, will be removed in 15.0") // TODO: https://gitlab.com/gitlab-org/gitlab-pages/-/issues/599
propagateCorrelationID = flag.Bool("propagate-correlation-id", false, "Reuse existing Correlation-ID from the incoming request header `X-Request-ID` if present")
+ serverShutdownTimeout = flag.Duration("server-shutdown-timeout", 30*time.Second, "GitLab Pages server shutdown timeout (default: 30s)")
logFormat = flag.String("log-format", "json", "The log output format: 'text' or 'json'")
logVerbose = flag.Bool("log-verbose", false, "Verbose logging")
secret = flag.String("auth-secret", "", "Cookie store hash key, should be at least 32 bytes long")