2021-01-03 14:25:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Metrics
|
|
|
|
module Dashboard
|
|
|
|
class SyncDashboardsWorker
|
|
|
|
include ApplicationWorker
|
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
sidekiq_options retry: 3
|
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
feature_category :metrics
|
2021-06-08 01:23:25 +05:30
|
|
|
tags :exclude_from_kubernetes
|
2021-01-03 14:25:43 +05:30
|
|
|
|
|
|
|
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
|