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

group_import_worker.rb « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d8f236013bf72ba126dd868e4282efa8a74c645d (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
# frozen_string_literal: true

class GroupImportWorker # rubocop:disable Scalability/IdempotentWorker
  include ApplicationWorker

  sidekiq_options retry: false
  feature_category :importers

  def perform(user_id, group_id)
    current_user = User.find(user_id)
    group = Group.find(group_id)
    group_import = group.build_import_state(jid: self.jid)

    group_import.start!

    ::Groups::ImportExport::ImportService.new(group: group, user: current_user).execute

    group_import.finish!
  rescue StandardError => e
    group_import&.fail_op(e.message)

    raise e
  end
end