diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-05-03 11:04:57 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-05-04 19:45:43 +0200 |
commit | 503d20954f10507b9b43c6ee1c38001e53cf0b14 (patch) | |
tree | 06e1aeddd995c2b8ff2fb48c0879187b2b819e4b /resources/transform.go | |
parent | 68e95327f7be941c44c256d2dac74ea96e731674 (diff) | |
download | hugo-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.go | 5 |
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 { |