💻 Code: Optimize to reduce unnecessary log output.
Browse files
main.py
CHANGED
@@ -620,7 +620,7 @@ async def ensure_config(request: Request, call_next):
|
|
620 |
if "default" not in app.state.config['preferences'].get('model_timeout', {}):
|
621 |
app.state.timeouts["default"] = DEFAULT_TIMEOUT
|
622 |
|
623 |
-
print("app.state.timeouts", app.state.timeouts)
|
624 |
|
625 |
if app and not hasattr(app.state, "channel_manager"):
|
626 |
if app.state.config and 'preferences' in app.state.config:
|
|
|
620 |
if "default" not in app.state.config['preferences'].get('model_timeout', {}):
|
621 |
app.state.timeouts["default"] = DEFAULT_TIMEOUT
|
622 |
|
623 |
+
# print("app.state.timeouts", app.state.timeouts)
|
624 |
|
625 |
if app and not hasattr(app.state, "channel_manager"):
|
626 |
if app.state.config and 'preferences' in app.state.config:
|
utils.py
CHANGED
@@ -289,7 +289,8 @@ async def load_config(app=None):
|
|
289 |
logger.error("配置文件 'api.yaml' 为空。请检查文件内容。")
|
290 |
config, api_keys_db, api_list = {}, {}, []
|
291 |
except FileNotFoundError:
|
292 |
-
|
|
|
293 |
config, api_keys_db, api_list = {}, {}, []
|
294 |
except YAMLError as e:
|
295 |
logger.error("配置文件 'api.yaml' 格式不正确。请检查 YAML 格式。%s", e)
|
|
|
289 |
logger.error("配置文件 'api.yaml' 为空。请检查文件内容。")
|
290 |
config, api_keys_db, api_list = {}, {}, []
|
291 |
except FileNotFoundError:
|
292 |
+
if not os.environ.get('CONFIG_URL'):
|
293 |
+
logger.error("'api.yaml' not found. Please check the file path.")
|
294 |
config, api_keys_db, api_list = {}, {}, []
|
295 |
except YAMLError as e:
|
296 |
logger.error("配置文件 'api.yaml' 格式不正确。请检查 YAML 格式。%s", e)
|