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

activate_service_worker.rb « applications « clusters « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4f285d5516276fe66820f1f5794e94e8f549eea3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module Clusters
  module Applications
    class ActivateServiceWorker
      include ApplicationWorker
      include ClusterQueue

      def perform(cluster_id, service_name)
        cluster = Clusters::Cluster.find_by_id(cluster_id)
        return unless cluster

        cluster.all_projects.find_each do |project|
          project.find_or_initialize_service(service_name).update!(active: true)
        end
      end
    end
  end
end