mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 09:58:04 +08:00
r2
This commit is contained in:
@ -1090,19 +1090,20 @@ class RagPipelineService:
|
||||
db.session.add(pipeline_customized_template)
|
||||
db.session.commit()
|
||||
|
||||
|
||||
def is_workflow_exist(self, pipeline: Pipeline) -> bool:
|
||||
return (
|
||||
db.session.query(Workflow)
|
||||
.filter(
|
||||
Workflow.tenant_id == pipeline.tenant_id,
|
||||
Workflow.app_id == pipeline.id,
|
||||
Workflow.version == Workflow.VERSION_DRAFT,
|
||||
)
|
||||
.count()
|
||||
) > 0
|
||||
|
||||
def get_node_last_run(self, pipeline: Pipeline, workflow: Workflow, node_id: str) -> WorkflowNodeExecutionModel | None:
|
||||
return (
|
||||
db.session.query(Workflow)
|
||||
.filter(
|
||||
Workflow.tenant_id == pipeline.tenant_id,
|
||||
Workflow.app_id == pipeline.id,
|
||||
Workflow.version == Workflow.VERSION_DRAFT,
|
||||
)
|
||||
.count()
|
||||
) > 0
|
||||
|
||||
def get_node_last_run(
|
||||
self, pipeline: Pipeline, workflow: Workflow, node_id: str
|
||||
) -> WorkflowNodeExecutionModel | None:
|
||||
# TODO(QuantumGhost): This query is not fully covered by index.
|
||||
criteria = (
|
||||
WorkflowNodeExecutionModel.tenant_id == pipeline.tenant_id,
|
||||
@ -1116,4 +1117,4 @@ class RagPipelineService:
|
||||
.order_by(WorkflowNodeExecutionModel.created_at.desc())
|
||||
.first()
|
||||
)
|
||||
return node_exec
|
||||
return node_exec
|
||||
|
||||
Reference in New Issue
Block a user