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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/gitlab/import/stuck_project_import_jobs_worker.rb')
-rw-r--r--app/workers/gitlab/import/stuck_project_import_jobs_worker.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/workers/gitlab/import/stuck_project_import_jobs_worker.rb b/app/workers/gitlab/import/stuck_project_import_jobs_worker.rb
new file mode 100644
index 00000000000..01979b2029f
--- /dev/null
+++ b/app/workers/gitlab/import/stuck_project_import_jobs_worker.rb
@@ -0,0 +1,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