🐛 Bug: Fix the bug where the os module was not imported.
Browse files
utils.py
CHANGED
@@ -279,6 +279,7 @@ def update_config(config_data, use_config_url=False):
|
|
279 |
|
280 |
# 读取YAML配置文件
|
281 |
async def load_config(app=None):
|
|
|
282 |
try:
|
283 |
with open(API_YAML_PATH, 'r', encoding='utf-8') as file:
|
284 |
conf = yaml.load(file)
|
@@ -302,7 +303,6 @@ async def load_config(app=None):
|
|
302 |
if config != {}:
|
303 |
return config, api_keys_db, api_list
|
304 |
|
305 |
-
import os
|
306 |
# 新增: 从环境变量获取配置URL并拉取配置
|
307 |
config_url = os.environ.get('CONFIG_URL')
|
308 |
if config_url:
|
|
|
279 |
|
280 |
# 读取YAML配置文件
|
281 |
async def load_config(app=None):
|
282 |
+
import os
|
283 |
try:
|
284 |
with open(API_YAML_PATH, 'r', encoding='utf-8') as file:
|
285 |
conf = yaml.load(file)
|
|
|
303 |
if config != {}:
|
304 |
return config, api_keys_db, api_list
|
305 |
|
|
|
306 |
# 新增: 从环境变量获取配置URL并拉取配置
|
307 |
config_url = os.environ.get('CONFIG_URL')
|
308 |
if config_url:
|