File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -1219,9 +1219,13 @@ def message_files(self) -> list[dict[str, Any]]:
12191219 @property
12201220 def workflow_run (self ):
12211221 if self .workflow_run_id :
1222- from . workflow import WorkflowRun
1222+ from sqlalchemy . orm import sessionmaker
12231223
1224- return db .session .query (WorkflowRun ).where (WorkflowRun .id == self .workflow_run_id ).first ()
1224+ from repositories .factory import DifyAPIRepositoryFactory
1225+
1226+ session_maker = sessionmaker (bind = db .engine , expire_on_commit = False )
1227+ repo = DifyAPIRepositoryFactory .create_api_workflow_run_repository (session_maker )
1228+ return repo .get_workflow_run_by_id_without_tenant (run_id = self .workflow_run_id )
12251229
12261230 return None
12271231
Original file line number Diff line number Diff line change @@ -1058,7 +1058,16 @@ class WorkflowAppLog(Base):
10581058
10591059 @property
10601060 def workflow_run (self ):
1061- return db .session .get (WorkflowRun , self .workflow_run_id )
1061+ if self .workflow_run_id :
1062+ from sqlalchemy .orm import sessionmaker
1063+
1064+ from repositories .factory import DifyAPIRepositoryFactory
1065+
1066+ session_maker = sessionmaker (bind = db .engine , expire_on_commit = False )
1067+ repo = DifyAPIRepositoryFactory .create_api_workflow_run_repository (session_maker )
1068+ return repo .get_workflow_run_by_id_without_tenant (run_id = self .workflow_run_id )
1069+
1070+ return None
10621071
10631072 @property
10641073 def created_by_account (self ):
You can’t perform that action at this time.
0 commit comments