Fix one more resource change eviction logic issue

This is how we should have fixed #1239.

Fixes #12456
This commit is contained in:
Bjørn Erik Pedersen
2024-05-05 10:44:35 +02:00
parent 503d20954f
commit bb59a7ed97
3 changed files with 67 additions and 46 deletions

View File

@@ -49,6 +49,7 @@ var (
_ resource.ReadSeekCloserResource = (*resourceAdapter)(nil)
_ resource.Resource = (*resourceAdapter)(nil)
_ resource.Staler = (*resourceAdapterInner)(nil)
_ identity.IdentityGroupProvider = (*resourceAdapterInner)(nil)
_ resource.Source = (*resourceAdapter)(nil)
_ resource.Identifier = (*resourceAdapter)(nil)
_ resource.ResourceNameTitleProvider = (*resourceAdapter)(nil)
@@ -657,6 +658,10 @@ type resourceAdapterInner struct {
*publishOnce
}
func (r *resourceAdapterInner) GetIdentityGroup() identity.Identity {
return r.target.GetIdentityGroup()
}
func (r *resourceAdapterInner) StaleVersion() uint32 {
// Both of these are incremented on change.
return r.Staler.StaleVersion() + r.target.StaleVersion()