fix: Pipeline 处理添加耗时日志和异常捕获

- message_pipeline.handle_message 添加每步耗时日志(租户解析/会话管理/消息处理)
- feishu_longconn_service Pipeline 调用包裹 try/catch,异常时记录完整堆栈
- feishu_bot.py 同样添加 Pipeline 异常捕获
- 防止 Pipeline 内部异常被静默吞掉导致消息无回复
This commit is contained in:
2026-04-08 09:07:50 +08:00
parent 54d4043805
commit a7ae72d0b2
7 changed files with 38 additions and 30 deletions

View File

@@ -48,9 +48,6 @@ def start_feishu_longconn_service():
try:
import logging
logger = logging.getLogger("feishu_longconn")
logger.info("=" * 80)
logger.info("🚀 启动飞书长连接服务(后台线程)")
logger.info("=" * 80)
from src.integrations.feishu_longconn_service import get_feishu_longconn_service
service = get_feishu_longconn_service()
@@ -76,9 +73,6 @@ def check_database_connection():
def main():
"""主函数"""
print("=" * 60)
print("TSP智能助手 - 综合管理平台")
print("=" * 60)
start_time = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
print(f"启动时间: {start_time}")
print()
@@ -91,9 +85,6 @@ def main():
# 检查必要目录
os.makedirs("logs", exist_ok=True)
os.makedirs("data", exist_ok=True)
logger.info("正在启动TSP智能助手综合管理平台...")
# 检查数据库连接
if not check_database_connection():
logger.error("数据库连接失败,退出启动")