diff options
Diffstat (limited to 'hugolib/site.go')
-rw-r--r-- | hugolib/site.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/hugolib/site.go b/hugolib/site.go index 2e23368d7..2e7e1d7f9 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -29,6 +29,8 @@ import ( "strings" "time" + "github.com/gohugoio/hugo/common/types" + "github.com/gohugoio/hugo/common/paths" "github.com/gohugoio/hugo/common/constants" @@ -523,13 +525,9 @@ But this also means that your site configuration may not do what you expect. If timeout := 30 * time.Second if cfg.Language.IsSet("timeout") { v := cfg.Language.Get("timeout") - if n := cast.ToInt(v); n > 0 { - timeout = time.Duration(n) * time.Millisecond - } else { - d, err := time.ParseDuration(cast.ToString(v)) - if err == nil { - timeout = d - } + d, err := types.ToDurationE(v) + if err == nil { + timeout = d } } |