Skip to content

Commit

Permalink
fix: save state in the database after each operation execution
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulFarault committed Nov 8, 2023
1 parent cb62338 commit 6497f49
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tdp/cli/commands/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ def deploy(
pass
return

# deployment and operations records are mutated by the iterator so we need to
# commit them before iterating and at each iteration
session.commit() # Update deployment status to RUNNING
for cluster_status_logs in deployment_iterator:
if cluster_status_logs and any(cluster_status_logs):
session.add_all(cluster_status_logs)
session.commit()
session.commit()

if deployment_iterator.deployment.status != DeploymentStateEnum.SUCCESS:
raise click.ClickException("Deployment failed.")
Expand Down

0 comments on commit 6497f49

Please sign in to comment.