From 68aea6bf10f432806fe5ceb1b346e28b0147b0c1 Mon Sep 17 00:00:00 2001 From: Miroslav Valcicak Date: Wed, 9 Apr 2025 16:18:58 +0200 Subject: [PATCH 1/2] feat: disable persistent config --- backend/open_webui/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index 8238f8a87..936bd3840 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -201,6 +201,7 @@ def save_config(config): T = TypeVar("T") +PERSISTENT_CONFIG_ENABLED = os.environ.get("PERSISTENT_CONFIG_ENABLED", "True").lower() == "true" class PersistentConfig(Generic[T]): def __init__(self, env_name: str, config_path: str, env_value: T): @@ -208,7 +209,7 @@ class PersistentConfig(Generic[T]): self.config_path = config_path self.env_value = env_value self.config_value = get_config_value(config_path) - if self.config_value is not None: + if self.config_value is not None and PERSISTENT_CONFIG_ENABLED: log.info(f"'{env_name}' loaded from the latest database entry") self.value = self.config_value else: From a5faaf388e2e961cc2d75a751ecad8a18654166e Mon Sep 17 00:00:00 2001 From: Miroslav Valcicak Date: Wed, 9 Apr 2025 21:22:25 +0200 Subject: [PATCH 2/2] refactor: rename persistent config variable --- backend/open_webui/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index 936bd3840..bdd6ec874 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -201,7 +201,7 @@ def save_config(config): T = TypeVar("T") -PERSISTENT_CONFIG_ENABLED = os.environ.get("PERSISTENT_CONFIG_ENABLED", "True").lower() == "true" +ENABLE_PERSISTENT_CONFIG = os.environ.get("ENABLE_PERSISTENT_CONFIG", "True").lower() == "true" class PersistentConfig(Generic[T]): def __init__(self, env_name: str, config_path: str, env_value: T): @@ -209,7 +209,7 @@ class PersistentConfig(Generic[T]): self.config_path = config_path self.env_value = env_value self.config_value = get_config_value(config_path) - if self.config_value is not None and PERSISTENT_CONFIG_ENABLED: + if self.config_value is not None and ENABLE_PERSISTENT_CONFIG: log.info(f"'{env_name}' loaded from the latest database entry") self.value = self.config_value else: