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
parent 4ad2ce5e03
commit 788d9271c1
No known key found for this signature in database
GPG Key ID: 2AE2BD5531FF94F4

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(