diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-11-25 12:49:04 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-11-25 18:59:06 +0100 |
commit | d6f7a9e28dfd5abff08b6aaf6fb3493c46bd1e39 (patch) | |
tree | f5715b86cff28eb5c7ab7320c30a492806441cae /hugolib/page__per_output.go | |
parent | 031f948f87ac97ca49d0a487a392a8a0c6afb699 (diff) |
resources/images: Make the image cache more robust
Also allow timeout to be set as a duration string, e.g. `30s`.
Fixes #6501
Diffstat (limited to 'hugolib/page__per_output.go')
-rw-r--r-- | hugolib/page__per_output.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/hugolib/page__per_output.go b/hugolib/page__per_output.go index 59de10be3..bc2a0accc 100644 --- a/hugolib/page__per_output.go +++ b/hugolib/page__per_output.go @@ -180,7 +180,7 @@ func newPageContentOutput(p *pageState) func(f output.Format) (*pageContentOutpu needTimeout := !p.renderable || p.shortcodeState.hasShortcodes() if needTimeout { - cp.initMain = parent.BranchdWithTimeout(p.s.siteCfg.timeout, func(ctx context.Context) (interface{}, error) { + cp.initMain = parent.BranchWithTimeout(p.s.siteCfg.timeout, func(ctx context.Context) (interface{}, error) { return nil, initContent() }) } else { @@ -249,8 +249,10 @@ type pageContentOutput struct { } func (p *pageContentOutput) Content() (interface{}, error) { - p.p.s.initInit(p.initMain, p.p) - return p.content, nil + if p.p.s.initInit(p.initMain, p.p) { + return p.content, nil + } + return nil, nil } func (p *pageContentOutput) FuzzyWordCount() int { |