MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / get_settings

Function get_settings

src/config/settings.py:920–932  ·  view source on GitHub ↗

获取全局配置实例(单例模式) 完全从数据库加载配置

()

Source from the content-addressed store, hash-verified

918
919
920def get_settings() -> Settings:
921 """
922 获取全局配置实例(单例模式)
923 完全从数据库加载配置
924 """
925 global _settings
926 if _settings is None:
927 # 先初始化默认设置(如果数据库中没有的话)
928 init_default_settings()
929 # 从数据库加载所有设置
930 settings_dict = _load_settings_from_db()
931 _settings = Settings(**settings_dict)
932 return _settings
933
934
935def update_settings(**kwargs) -> Settings:

Callers 15

setup_applicationFunction · 0.90
get_data_dirFunction · 0.85
get_logs_dirFunction · 0.85
get_proxy_url_for_taskFunction · 0.85
__init__Method · 0.85
_run_anyauto_fallbackMethod · 0.85
save_to_databaseMethod · 0.85
_settings_configFunction · 0.85

Calls 3

init_default_settingsFunction · 0.85
_load_settings_from_dbFunction · 0.85
SettingsClass · 0.85

Tested by 2

test_tempmail_serviceFunction · 0.68
test_dynamic_proxyFunction · 0.68