Commit b2ea9c2a authored by Robert Speicher's avatar Robert Speicher

Merge branch '218563-remove-old-stuck-import-jobs-worker' into 'master'

Remove unused StuckImportJobsWorker

See merge request gitlab-org/gitlab!34050
parents d997e1e1 c1b7e4a1
...@@ -339,14 +339,6 @@ ...@@ -339,14 +339,6 @@
:weight: 1 :weight: 1
:idempotent: :idempotent:
:tags: [] :tags: []
- :name: cronjob:stuck_import_jobs
:feature_category: :importers
:has_external_dependencies:
:urgency: :low
:resource_boundary: :cpu
:weight: 1
:idempotent:
:tags: []
- :name: cronjob:stuck_merge_jobs - :name: cronjob:stuck_merge_jobs
:feature_category: :source_code_management :feature_category: :source_code_management
:has_external_dependencies: :has_external_dependencies:
......
# frozen_string_literal: true
class StuckImportJobsWorker # 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
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe StuckImportJobsWorker do
let(:worker) { described_class.new }
describe 'with scheduled import_status' do
it_behaves_like 'stuck import job detection' do
let(:import_state) { create(:project, :import_scheduled).import_state }
before do
import_state.update(jid: '123')
end
end
end
describe 'with started import_status' do
it_behaves_like 'stuck import job detection' do
let(:import_state) { create(:project, :import_started).import_state }
before do
import_state.update(jid: '123')
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment