Skip to content

Commit 6a071a2

Browse files
authoredMar 20, 2024
vars: set _was_touched when updating cached vars (#2886)
Ensure that updated cached vars are persisted into redis.
1 parent 1a66e14 commit 6a071a2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎reflex/vars.py

+2
Original file line numberDiff line numberDiff line change
@@ -1861,6 +1861,8 @@ def __get__(self, instance, owner):
18611861
# handle caching
18621862
if not hasattr(instance, self._cache_attr):
18631863
setattr(instance, self._cache_attr, super().__get__(instance, owner))
1864+
# Ensure the computed var gets serialized to redis.
1865+
instance._was_touched = True
18641866
return getattr(instance, self._cache_attr)
18651867

18661868
def _deps(

0 commit comments

Comments
 (0)