fix: Pipeline 处理添加耗时日志和异常捕获
- message_pipeline.handle_message 添加每步耗时日志(租户解析/会话管理/消息处理) - feishu_longconn_service Pipeline 调用包裹 try/catch,异常时记录完整堆栈 - feishu_bot.py 同样添加 Pipeline 异常捕获 - 防止 Pipeline 内部异常被静默吞掉导致消息无回复
This commit is contained in:
@@ -63,10 +63,8 @@ class DatabaseManager:
|
||||
autoflush=False,
|
||||
bind=self.engine
|
||||
)
|
||||
|
||||
# 创建所有表
|
||||
Base.metadata.create_all(bind=self.engine)
|
||||
logger.info("数据库初始化成功")
|
||||
|
||||
# 运行 schema 迁移(处理字段变更)
|
||||
self._run_migrations()
|
||||
@@ -169,7 +167,6 @@ class DatabaseManager:
|
||||
if self.engine:
|
||||
self.engine.dispose()
|
||||
self._initialize_database()
|
||||
logger.info("数据库重新连接成功")
|
||||
return True
|
||||
except Exception as e:
|
||||
logger.error(f"数据库重新连接失败: {e}")
|
||||
|
||||
@@ -191,7 +191,6 @@ def create_session_store() -> SessionStore:
|
||||
socket_timeout=2
|
||||
)
|
||||
client.ping()
|
||||
logger.info("会话存储使用 Redis")
|
||||
return RedisSessionStore(client)
|
||||
except Exception as e:
|
||||
logger.info(f"Redis 不可用({e}),会话存储使用内存")
|
||||
|
||||
Reference in New Issue
Block a user