diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 09:09:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 09:09:26 +0300 |
commit | 8ed964b6605f8b6d790cb46db80c5cc8de7783b6 (patch) | |
tree | 430d6fe5538a3bf417e90bdc859b4f25703e4433 /app/services/terraform | |
parent | 82013498a3be9fb17ed05c7dcf67df84fa83fb2f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/terraform')
-rw-r--r-- | app/services/terraform/states/trigger_destroy_service.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/terraform/states/trigger_destroy_service.rb b/app/services/terraform/states/trigger_destroy_service.rb index 3669bdcf716..3347d429bb4 100644 --- a/app/services/terraform/states/trigger_destroy_service.rb +++ b/app/services/terraform/states/trigger_destroy_service.rb @@ -12,9 +12,11 @@ module Terraform return unauthorized_response unless can_destroy_state? return state_locked_response if state.locked? - state.update!(deleted_at: Time.current) + state.run_after_commit do + Terraform::States::DestroyWorker.perform_async(id) + end - Terraform::States::DestroyWorker.perform_async(state.id) + state.update!(deleted_at: Time.current) ServiceResponse.success end |