summaryrefslogtreecommitdiff
path: root/app/workers/gitlab/import/stuck_project_import_jobs_worker.rb
blob: 01979b2029f0043ffe8fa3a3079939b2567159ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 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