Skip to content

Commit

Permalink
When REDIS_URL is set, use redis, regardless of config preference. (#…
Browse files Browse the repository at this point in the history
…4196)

We might change this down the road, but we don't want to introduce a breaking
change at this time.
  • Loading branch information
masenf authored Oct 17, 2024
1 parent e14c79d commit 330c280
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions reflex/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -2566,6 +2566,8 @@ def create(cls, state: Type[BaseState]):
The state manager (either disk, memory or redis).
"""
config = get_config()
if prerequisites.parse_redis_url() is not None:
config.state_manager_mode = constants.StateManagerMode.REDIS
if config.state_manager_mode == constants.StateManagerMode.MEMORY:
return StateManagerMemory(state=state)
if config.state_manager_mode == constants.StateManagerMode.DISK:
Expand Down

0 comments on commit 330c280

Please sign in to comment.