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

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

module Metrics
  module Dashboard
    class SyncDashboardsWorker
      include ApplicationWorker

      data_consistency :always

      sidekiq_options retry: 3

      feature_category :metrics

      idempotent!

      def perform(project_id)
        project = Project.find(project_id)
        dashboard_paths = ::Gitlab::Metrics::Dashboard::RepoDashboardFinder.list_dashboards(project)

        dashboard_paths.each do |dashboard_path|
          ::Gitlab::Metrics::Dashboard::Importer.new(dashboard_path, project).execute!
        end
      end
    end
  end
end