Skip to content

Commit

Permalink
fix: ensure workflow run persistence before refresh
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
laipz8200 committed Nov 18, 2024
1 parent 3d85cec commit f414d82
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api/core/app/task_pipeline/workflow_cycle_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ def _handle_workflow_run_failed(
).total_seconds()
db.session.commit()

db.session.add(workflow_run)
db.session.refresh(workflow_run)
db.session.close()

Expand Down

0 comments on commit f414d82

Please sign in to comment.