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

stuck_project_import_jobs_worker.rb « import « gitlab « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 93d670e1b8b9e128ef8bfb9fd0772cf6806ec265 (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 Gitlab
  module Import
    class StuckProjectImportJobsWorker # rubocop:disable Scalability/IdempotentWorker
      include Gitlab::Import::StuckImportJob

      private

      def track_metrics(with_jid_count, without_jid_count)
        Gitlab::Metrics.add_event(
          :stuck_import_jobs,
          projects_without_jid_count: without_jid_count,
          projects_with_jid_count: with_jid_count
        )
      end

      def enqueued_import_states
        ProjectImportState.with_status([:scheduled, :started])
      end
    end
  end
end