fix: ensure workflow run persistence before refresh

Adds the workflow run object to the database session to guarantee it is persisted prior to refreshing its state. This change resolves potential issues with data consistency and integrity when the workflow run is accessed after operations. References issue #123 for more context.
This commit is contained in:
-LAN- 2024-11-14 21:21:55 +08:00
parent 02c39b2631
commit fb94d0b7cf

View File

@ -217,6 +217,7 @@ class WorkflowCycleManage:
).total_seconds()
db.session.commit()
db.session.add(workflow_run)
db.session.refresh(workflow_run)
db.session.close()