[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot] 2025-12-12 04:31:09 +00:00 committed by hjlarry
parent ad438740c4
commit da6fa55eed
2 changed files with 23 additions and 17 deletions

View File

@ -328,20 +328,26 @@ class DifyAPISQLAlchemyWorkflowNodeExecutionRepository(DifyAPIWorkflowNodeExecut
if not node_execution_ids:
return 0, 0
offloads_deleted = cast(
CursorResult,
session.execute(
delete(WorkflowNodeExecutionOffload).where(
WorkflowNodeExecutionOffload.node_execution_id.in_(node_execution_ids)
)
),
).rowcount or 0
offloads_deleted = (
cast(
CursorResult,
session.execute(
delete(WorkflowNodeExecutionOffload).where(
WorkflowNodeExecutionOffload.node_execution_id.in_(node_execution_ids)
)
),
).rowcount
or 0
)
node_executions_deleted = cast(
CursorResult,
session.execute(
delete(WorkflowNodeExecutionModel).where(WorkflowNodeExecutionModel.id.in_(node_execution_ids))
),
).rowcount or 0
node_executions_deleted = (
cast(
CursorResult,
session.execute(
delete(WorkflowNodeExecutionModel).where(WorkflowNodeExecutionModel.id.in_(node_execution_ids))
),
).rowcount
or 0
)
return node_executions_deleted, offloads_deleted

View File

@ -54,9 +54,9 @@ class FakeRepo:
self.call_idx += 1
return batch
def delete_runs_with_related(self, runs: list[FakeRun],
delete_node_executions=None,
delete_trigger_logs=None) -> dict[str, int]:
def delete_runs_with_related(
self, runs: list[FakeRun], delete_node_executions=None, delete_trigger_logs=None
) -> dict[str, int]:
self.deleted.append([run.id for run in runs])
result = self.delete_result.copy()
result["runs"] = len(runs)