vars: set _was_touched when updating cached vars (#2886)

Ensure that updated cached vars are persisted into redis.
This commit is contained in:
Masen Furer 2024-03-20 09:50:42 -07:00 committed by GitHub
parent 1a66e145b5
commit 6a071a27e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1861,6 +1861,8 @@ class ComputedVar(Var, property):
# handle caching
if not hasattr(instance, self._cache_attr):
setattr(instance, self._cache_attr, super().__get__(instance, owner))
# Ensure the computed var gets serialized to redis.
instance._was_touched = True
return getattr(instance, self._cache_attr)
def _deps(