修复webhook url指定

This commit is contained in:
2025-10-29 12:14:50 +08:00
parent d36bb2de83
commit c80fb67165
2 changed files with 12 additions and 13 deletions

10
app.py
View File

@@ -7,7 +7,7 @@ from fastapi.responses import JSONResponse
from contextlib import asynccontextmanager
import asyncio
from config import APP_CONFIG, SESSION_TIMEOUT
from config import APP_CONFIG, SESSION_TIMEOUT, SetWebhookURL, GetWebhookURL
from core.middleware import ConcurrencyLimitMiddleware
from core.database import get_db
from routers import callback, health
@@ -125,14 +125,8 @@ if __name__ == "__main__":
# 如果提供了webhook URL设置环境变量
if args.webhook_url:
os.environ['WEBHOOK_URL'] = args.webhook_url
SetWebhookURL(args.webhook_url)
logger.info(f"设置Webhook URL: {args.webhook_url}")
# 重新导入配置模块以更新WEBHOOK_URL
import importlib
import config
importlib.reload(config)
logger.info(f"更新后的Webhook URL: {config.WEBHOOK_URL}")
# 启动服务器
uvicorn.run(