aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/page__new.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-10-23 19:26:13 +0200
committerBjørn Erik Pedersen <[email protected]>2024-10-24 13:34:11 +0200
commitcb6e27b32a1d09956027b8e45bae0c18c1593d5c (patch)
treebd3031431175596ddfad3a79daf69563f723ac6f /hugolib/page__new.go
parent5bbe95f9c5442898cdfb100bff4f1aac52fce5ad (diff)
downloadhugo-cb6e27b32a1d09956027b8e45bae0c18c1593d5c.tar.gz
hugo-cb6e27b32a1d09956027b8e45bae0c18c1593d5c.zip
hugolib/commands: Fix stuck server error issues
Fixes #11378
Diffstat (limited to 'hugolib/page__new.go')
-rw-r--r--hugolib/page__new.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/hugolib/page__new.go b/hugolib/page__new.go
index b7d9b10f2..9a4972d07 100644
--- a/hugolib/page__new.go
+++ b/hugolib/page__new.go
@@ -34,6 +34,15 @@ import (
var pageIDCounter atomic.Uint64
func (h *HugoSites) newPage(m *pageMeta) (*pageState, *paths.Path, error) {
+ p, pth, err := h.doNewPage(m)
+ if err != nil {
+ // Make sure that any partially created page part is marked as stale.
+ m.MarkStale()
+ }
+ return p, pth, err
+}
+
+func (h *HugoSites) doNewPage(m *pageMeta) (*pageState, *paths.Path, error) {
m.Staler = &resources.AtomicStaler{}
if m.pageMetaParams == nil {
m.pageMetaParams = &pageMetaParams{
@@ -231,10 +240,6 @@ func (h *HugoSites) newPage(m *pageMeta) (*pageState, *paths.Path, error) {
}
return ps, nil
}()
- // Make sure to evict any cached and now stale data.
- if err != nil {
- m.MarkStale()
- }
if ps == nil {
return nil, nil, err