summaryrefslogtreecommitdiff
path: root/caddyconfig
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2022-08-03 11:04:51 -0600
committerGitHub <noreply@github.com>2022-08-03 11:04:51 -0600
commit1960a0dc117dd30fb507b390ddf93b2ef371b9ad (patch)
tree42837b24d53dd449ac153d7b1d252ee8422e4729 /caddyconfig
parent63c7720e84176184698730fed0ca7c402c53481a (diff)
httpserver: Configurable shutdown delay (#4906)
Diffstat (limited to 'caddyconfig')
-rw-r--r--caddyconfig/httpcaddyfile/httptype.go9
-rw-r--r--caddyconfig/httpcaddyfile/options.go1
2 files changed, 6 insertions, 4 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go
index 7153b8c..cca864d 100644
--- a/caddyconfig/httpcaddyfile/httptype.go
+++ b/caddyconfig/httpcaddyfile/httptype.go
@@ -190,10 +190,11 @@ func (st ServerType) Setup(inputServerBlocks []caddyfile.ServerBlock,
// now that each server is configured, make the HTTP app
httpApp := caddyhttp.App{
- HTTPPort: tryInt(options["http_port"], &warnings),
- HTTPSPort: tryInt(options["https_port"], &warnings),
- GracePeriod: tryDuration(options["grace_period"], &warnings),
- Servers: servers,
+ HTTPPort: tryInt(options["http_port"], &warnings),
+ HTTPSPort: tryInt(options["https_port"], &warnings),
+ GracePeriod: tryDuration(options["grace_period"], &warnings),
+ ShutdownDelay: tryDuration(options["shutdown_delay"], &warnings),
+ Servers: servers,
}
// then make the TLS app
diff --git a/caddyconfig/httpcaddyfile/options.go b/caddyconfig/httpcaddyfile/options.go
index d9af04e..36f8f4b 100644
--- a/caddyconfig/httpcaddyfile/options.go
+++ b/caddyconfig/httpcaddyfile/options.go
@@ -31,6 +31,7 @@ func init() {
RegisterGlobalOption("https_port", parseOptHTTPSPort)
RegisterGlobalOption("default_bind", parseOptStringList)
RegisterGlobalOption("grace_period", parseOptDuration)
+ RegisterGlobalOption("shutdown_delay", parseOptDuration)
RegisterGlobalOption("default_sni", parseOptSingleString)
RegisterGlobalOption("order", parseOptOrder)
RegisterGlobalOption("storage", parseOptStorage)