diff options
author | Francis Lavoie <[email protected]> | 2020-05-11 18:41:11 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-11 16:41:11 -0600 |
commit | ef6e53bb5f521e4d400849b79bc72e89fe2a7484 (patch) | |
tree | d1190ba7f084ec1ec8b99a6c8ea8e30ec1dfdb21 /modules/logging/filewriter.go | |
parent | 35e1d92d588fadc8e5d619ffb81319dd8f7ba43a (diff) | |
download | caddy-ef6e53bb5f521e4d400849b79bc72e89fe2a7484.tar.gz caddy-ef6e53bb5f521e4d400849b79bc72e89fe2a7484.zip |
core: Add support for `d` duration unit (#3323)
* caddy: Add support for `d` duration unit
* Improvements to ParseDuration; add unit tests
Co-authored-by: Matthew Holt <[email protected]>
Diffstat (limited to 'modules/logging/filewriter.go')
-rw-r--r-- | modules/logging/filewriter.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/logging/filewriter.go b/modules/logging/filewriter.go index 59f5b2aea..376deeb2e 100644 --- a/modules/logging/filewriter.go +++ b/modules/logging/filewriter.go @@ -21,7 +21,6 @@ import ( "os" "path/filepath" "strconv" - "time" "github.com/caddyserver/caddy/v2" "github.com/caddyserver/caddy/v2/caddyconfig/caddyfile" @@ -194,7 +193,7 @@ func (fw *FileWriter) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { if !d.AllArgs(&keepForStr) { return d.ArgErr() } - keepFor, err := time.ParseDuration(keepForStr) + keepFor, err := caddy.ParseDuration(keepForStr) if err != nil { return d.Errf("parsing roll_keep_for duration: %v", err) } |