When REDIS_URL is set, use redis, regardless of config preference. (#4196)

We might change this down the road, but we don't want to introduce a breaking
change at this time.
This commit is contained in:
Masen Furer 2024-10-17 16:54:36 -07:00 committed by GitHub
parent e14c79d57d
commit 330c280c78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2566,6 +2566,8 @@ class StateManager(Base, ABC):
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: