Skip to content

Commit

Permalink
add rollback,
Browse files Browse the repository at this point in the history
Q: should we add logger ?
  • Loading branch information
0oM4R committed Sep 14, 2023
1 parent 586f268 commit 754fa06
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion v2go2tgrid/tfgrid/deployer.v
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ pub fn (mut d Deployer) deploy(node_id u32, mut dl Deployment, body string, solu
node_twin_id := d.get_node_twin(node_id)!
d.rmb_deployment_deploy(node_twin_id, payload)!
workload_versions := d.assign_versions(dl)
d.wait_deployment(node_id, contract_id, workload_versions)!
d.wait_deployment(node_id, contract_id, workload_versions) or {
println("Rolling back...")
println("deleting contract id: ${contract_id}")
d.cancel_contract(contract_id) or { return err }
return err
}
return contract_id
}

Expand Down

0 comments on commit 754fa06

Please sign in to comment.