blob: 7e257afc4d90222a47b8a30da5a791fc30bbd135 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# frozen_string_literal: true
module Gitlab
module JiraImport
module Stage
class ImportIssuesWorker # rubocop:disable Scalability/IdempotentWorker
include Gitlab::JiraImport::ImportWorker
private
def import(project)
jobs_waiter = Gitlab::JiraImport::IssuesImporter.new(project).execute
project.import_state.refresh_jid_expiration
Gitlab::JiraImport::AdvanceStageWorker.perform_async(
project.id,
{ jobs_waiter.key => jobs_waiter.jobs_remaining },
next_stage(project)
)
end
def next_stage(project)
Gitlab::JiraImport.get_issues_next_start_at(project.id) < 0 ? :attachments : :issues
end
end
end
end
end
|