mirror of
https://git.mirrors.martin98.com/https://github.com/open-webui/open-webui
synced 2025-08-18 04:25:52 +08:00
Merge pull request #12654 from valckmir/main
feat: disable persistent config
This commit is contained in:
commit
a27dcc84a3
@ -201,6 +201,7 @@ def save_config(config):
|
|||||||
|
|
||||||
T = TypeVar("T")
|
T = TypeVar("T")
|
||||||
|
|
||||||
|
ENABLE_PERSISTENT_CONFIG = os.environ.get("ENABLE_PERSISTENT_CONFIG", "True").lower() == "true"
|
||||||
|
|
||||||
class PersistentConfig(Generic[T]):
|
class PersistentConfig(Generic[T]):
|
||||||
def __init__(self, env_name: str, config_path: str, env_value: 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.config_path = config_path
|
||||||
self.env_value = env_value
|
self.env_value = env_value
|
||||||
self.config_value = get_config_value(config_path)
|
self.config_value = get_config_value(config_path)
|
||||||
if self.config_value is not None:
|
if self.config_value is not None and ENABLE_PERSISTENT_CONFIG:
|
||||||
log.info(f"'{env_name}' loaded from the latest database entry")
|
log.info(f"'{env_name}' loaded from the latest database entry")
|
||||||
self.value = self.config_value
|
self.value = self.config_value
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user