aboutsummaryrefslogtreecommitdiffhomepage
path: root/resources/transform.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-05-03 11:04:57 +0200
committerBjørn Erik Pedersen <[email protected]>2024-05-04 19:45:43 +0200
commit503d20954f10507b9b43c6ee1c38001e53cf0b14 (patch)
tree06e1aeddd995c2b8ff2fb48c0879187b2b819e4b /resources/transform.go
parent68e95327f7be941c44c256d2dac74ea96e731674 (diff)
downloadhugo-503d20954f10507b9b43c6ee1c38001e53cf0b14.tar.gz
hugo-503d20954f10507b9b43c6ee1c38001e53cf0b14.zip
Make the cache eviction logic for stale entities more robust
Fixes #12458
Diffstat (limited to 'resources/transform.go')
-rw-r--r--resources/transform.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/resources/transform.go b/resources/transform.go
index d9084b178..b498924f5 100644
--- a/resources/transform.go
+++ b/resources/transform.go
@@ -657,8 +657,9 @@ type resourceAdapterInner struct {
*publishOnce
}
-func (r *resourceAdapterInner) IsStale() bool {
- return r.Staler.IsStale() || r.target.IsStale()
+func (r *resourceAdapterInner) StaleVersion() uint32 {
+ // Both of these are incremented on change.
+ return r.Staler.StaleVersion() + r.target.StaleVersion()
}
type resourceTransformations struct {