diff options
author | Matt Holt <[email protected]> | 2022-08-03 11:04:51 -0600 |
---|---|---|
committer | GitHub <[email protected]> | 2022-08-03 11:04:51 -0600 |
commit | 1960a0dc117dd30fb507b390ddf93b2ef371b9ad (patch) | |
tree | 42837b24d53dd449ac153d7b1d252ee8422e4729 /caddyconfig | |
parent | 63c7720e84176184698730fed0ca7c402c53481a (diff) | |
download | caddy-1960a0dc117dd30fb507b390ddf93b2ef371b9ad.tar.gz caddy-1960a0dc117dd30fb507b390ddf93b2ef371b9ad.zip |
httpserver: Configurable shutdown delay (#4906)
Diffstat (limited to 'caddyconfig')
-rw-r--r-- | caddyconfig/httpcaddyfile/httptype.go | 9 | ||||
-rw-r--r-- | caddyconfig/httpcaddyfile/options.go | 1 |
2 files changed, 6 insertions, 4 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go index 7153b8c05..cca864d06 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 d9af04ed3..36f8f4b14 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) |