mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 02:36:29 +08:00
fix: sqlalchemy.exc.InvalidRequestError: Can't operate on closed tran… (#34407)
This commit is contained in:
parent
2b9eb06555
commit
e41965061c
@ -593,17 +593,15 @@ class PublishedRagPipelineApi(Resource):
|
|||||||
# The role of the current user in the ta table must be admin, owner, or editor
|
# The role of the current user in the ta table must be admin, owner, or editor
|
||||||
current_user, _ = current_account_with_tenant()
|
current_user, _ = current_account_with_tenant()
|
||||||
rag_pipeline_service = RagPipelineService()
|
rag_pipeline_service = RagPipelineService()
|
||||||
with sessionmaker(db.engine).begin() as session:
|
workflow = rag_pipeline_service.publish_workflow(
|
||||||
pipeline = session.merge(pipeline)
|
session=db.session, # type: ignore[reportArgumentType,arg-type]
|
||||||
workflow = rag_pipeline_service.publish_workflow(
|
pipeline=pipeline,
|
||||||
session=session,
|
account=current_user,
|
||||||
pipeline=pipeline,
|
)
|
||||||
account=current_user,
|
pipeline.is_published = True
|
||||||
)
|
pipeline.workflow_id = workflow.id
|
||||||
pipeline.is_published = True
|
db.session.commit()
|
||||||
pipeline.workflow_id = workflow.id
|
workflow_created_at = TimestampField().format(workflow.created_at)
|
||||||
session.add(pipeline)
|
|
||||||
workflow_created_at = TimestampField().format(workflow.created_at)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"result": "success",
|
"result": "success",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user