2018-06-27 07:23:28 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 18:09:10 +00:00
|
|
|
class StuckImportJobsWorker # rubocop:disable Scalability/IdempotentWorker
|
2020-05-29 18:08:26 +00:00
|
|
|
include Gitlab::Import::StuckImportJob
|
2017-03-24 11:08:34 +00:00
|
|
|
|
2017-08-17 09:00:31 +00:00
|
|
|
private
|
|
|
|
|
2020-05-29 18:08:26 +00:00
|
|
|
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
|
2020-05-25 15:07:58 +00:00
|
|
|
)
|
2017-08-17 09:00:31 +00:00
|
|
|
end
|
2017-03-24 11:08:34 +00:00
|
|
|
|
2018-11-07 14:32:15 +00:00
|
|
|
def enqueued_import_states
|
|
|
|
ProjectImportState.with_status([:scheduled, :started])
|
2017-03-24 11:08:34 +00:00
|
|
|
end
|
|
|
|
end
|