Welcome to mirror list, hosted at ThFree Co, Russian Federation.

destroy_worker.rb « states « terraform « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 48abf0f22b89f8c70ddff5d515fa223ed0559e34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

module Terraform
  module States
    class DestroyWorker
      include ApplicationWorker

      queue_namespace :terraform
      feature_category :infrastructure_as_code

      deduplicate :until_executed
      idempotent!
      urgency :low
      data_consistency :always

      def perform(terraform_state_id)
        if state = Terraform::State.find_by_id(terraform_state_id)
          Terraform::States::DestroyService.new(state).execute
        end
      end
    end
  end
end