fix: ENABLE_PERSISTENT_CONFIG redis issue

This commit is contained in:
Timothy Jaeryang Baek
2026-01-22 03:59:00 +04:00
parent 474427c67e
commit 5d48e48e15

View File

@@ -257,7 +257,7 @@ class AppConfig:
self._state[key].value = value
self._state[key].save()
if self._redis:
if self._redis and ENABLE_PERSISTENT_CONFIG:
redis_key = f"{self._redis_key_prefix}:config:{key}"
self._redis.set(redis_key, json.dumps(self._state[key].value))
@@ -265,8 +265,8 @@ class AppConfig:
if key not in self._state:
raise AttributeError(f"Config key '{key}' not found")
# If Redis is available, check for an updated value
if self._redis:
# If Redis is available and persistent config is enabled, check for an updated value
if self._redis and ENABLE_PERSISTENT_CONFIG:
redis_key = f"{self._redis_key_prefix}:config:{key}"
redis_value = self._redis.get(redis_key)