fix: Fix database connection leak in EasyUIBasedGenerateTaskPipeline (#24815)
This commit is contained in:
@@ -472,9 +472,10 @@ class EasyUIBasedGenerateTaskPipeline(BasedGenerateTaskPipeline):
|
|||||||
:param event: agent thought event
|
:param event: agent thought event
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
agent_thought: Optional[MessageAgentThought] = (
|
with Session(db.engine, expire_on_commit=False) as session:
|
||||||
db.session.query(MessageAgentThought).where(MessageAgentThought.id == event.agent_thought_id).first()
|
agent_thought: Optional[MessageAgentThought] = (
|
||||||
)
|
session.query(MessageAgentThought).where(MessageAgentThought.id == event.agent_thought_id).first()
|
||||||
|
)
|
||||||
|
|
||||||
if agent_thought:
|
if agent_thought:
|
||||||
return AgentThoughtStreamResponse(
|
return AgentThoughtStreamResponse(
|
||||||
|
Reference in New Issue
Block a user