Skip to content

Commit

Permalink
refactor: make sure the Active branch won't be removed in the future
Browse files Browse the repository at this point in the history
  • Loading branch information
ilbertt committed May 19, 2024
1 parent cd680c5 commit 8ea6e02
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions src/backend/src/api/endpoints/deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,12 @@ impl DeploymentsEndpoints {
}

match update {
DeploymentState::Active => {}
DeploymentState::Active => self.deployments_service.update_deployment_state(
calling_principal,
deployment_id,
update,
false,
),
DeploymentState::FailedOnClient { .. } => {
if let Err(e) = try_close_akash_deployment(&deployment_id).await {
return self.deployments_service.set_failed_deployment(
Expand All @@ -387,21 +392,19 @@ impl DeploymentsEndpoints {
e.message().to_string(),
);
}

self.deployments_service.update_deployment_state(
calling_principal,
deployment_id,
update,
false,
)
}
_ => {
return Err(ApiError::invalid_argument(&format!(
"Invalid update for deployment: {:?}",
update
)))
}
_ => Err(ApiError::invalid_argument(&format!(
"Invalid update for deployment: {:?}",
update
))),
}

self.deployments_service.update_deployment_state(
calling_principal,
deployment_id,
update,
false,
)
}

async fn close_deployment(
Expand Down

0 comments on commit 8ea6e02

Please sign in to comment.