Browse Source

fix: Fix database connection leak in EasyUIBasedGenerateTaskPipeline (#24815)

tags/1.8.1
耐小心 2 months ago
parent
commit
d5a521eef2
No account linked to committer's email address

+ 4
- 3
api/core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py View File

:param event: agent thought event :param event: agent thought event
:return: :return:
""" """
agent_thought: Optional[MessageAgentThought] = (
db.session.query(MessageAgentThought).where(MessageAgentThought.id == event.agent_thought_id).first()
)
with Session(db.engine, expire_on_commit=False) as session:
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(

Loading…
Cancel
Save