修复webhook url指定
This commit is contained in:
10
app.py
10
app.py
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user