Ver código fonte

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

tags/1.8.1
耐小心 2 meses atrás
pai
commit
d5a521eef2
Nenhuma conta vinculada ao e-mail do autor do commit

+ 4
- 3
api/core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py Ver arquivo

@@ -472,9 +472,10 @@ class EasyUIBasedGenerateTaskPipeline(BasedGenerateTaskPipeline):
:param event: agent thought event
: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:
return AgentThoughtStreamResponse(

Carregando…
Cancelar
Salvar