mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
resources/images: Make the image cache more robust
Also allow timeout to be set as a duration string, e.g. `30s`. Fixes #6501
This commit is contained in:
@@ -64,7 +64,7 @@ func (ini *Init) Branch(initFn func() (interface{}, error)) *Init {
|
||||
}
|
||||
|
||||
// BranchdWithTimeout is same as Branch, but with a timeout.
|
||||
func (ini *Init) BranchdWithTimeout(timeout time.Duration, f func(ctx context.Context) (interface{}, error)) *Init {
|
||||
func (ini *Init) BranchWithTimeout(timeout time.Duration, f func(ctx context.Context) (interface{}, error)) *Init {
|
||||
return ini.Branch(func() (interface{}, error) {
|
||||
return ini.withTimeout(timeout, f)
|
||||
})
|
||||
|
Reference in New Issue
Block a user