diff options
author | Aziz Rmadi <[email protected]> | 2024-04-23 08:12:57 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2024-04-23 07:12:57 -0600 |
commit | 868af6a062290b82fb1d4d70697739974e814e50 (patch) | |
tree | 2f73a23f2b7f2157f6f8002456cc027ac94e85d9 /modules/caddyhttp/reverseproxy | |
parent | d2668cdbb06da8e2c96b072ee589465c20dd8118 (diff) | |
download | caddy-868af6a062290b82fb1d4d70697739974e814e50.tar.gz caddy-868af6a062290b82fb1d4d70697739974e814e50.zip |
reverse_proxy: Add grace_period for SRV upstreams to Caddyfile (#6264)
Diffstat (limited to 'modules/caddyhttp/reverseproxy')
-rw-r--r-- | modules/caddyhttp/reverseproxy/caddyfile.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/caddyhttp/reverseproxy/caddyfile.go b/modules/caddyhttp/reverseproxy/caddyfile.go index 31fdd077c..ef0eea396 100644 --- a/modules/caddyhttp/reverseproxy/caddyfile.go +++ b/modules/caddyhttp/reverseproxy/caddyfile.go @@ -1356,6 +1356,7 @@ func (h *CopyResponseHeadersHandler) UnmarshalCaddyfile(d *caddyfile.Dispenser) // resolvers <resolvers...> // dial_timeout <timeout> // dial_fallback_delay <timeout> +// grace_period <duration> // } func (u *SRVUpstreams) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { d.Next() // consume upstream source name @@ -1435,7 +1436,15 @@ func (u *SRVUpstreams) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { return d.Errf("bad delay value '%s': %v", d.Val(), err) } u.FallbackDelay = caddy.Duration(dur) - + case "grace_period": + if !d.NextArg() { + return d.ArgErr() + } + dur, err := caddy.ParseDuration(d.Val()) + if err != nil { + return d.Errf("bad grace period value '%s': %v", d.Val(), err) + } + u.GracePeriod = caddy.Duration(dur) default: return d.Errf("unrecognized srv option '%s'", d.Val()) } |