diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /lib/bulk_imports/importers/groups_importer.rb | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'lib/bulk_imports/importers/groups_importer.rb')
-rw-r--r-- | lib/bulk_imports/importers/groups_importer.rb | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/lib/bulk_imports/importers/groups_importer.rb b/lib/bulk_imports/importers/groups_importer.rb deleted file mode 100644 index 8641577ff47..00000000000 --- a/lib/bulk_imports/importers/groups_importer.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -module BulkImports - module Importers - class GroupsImporter - def initialize(bulk_import_id) - @bulk_import = BulkImport.find(bulk_import_id) - end - - def execute - bulk_import.start! unless bulk_import.started? - - if entities_to_import.empty? - bulk_import.finish! - else - entities_to_import.each do |entity| - BulkImports::Importers::GroupImporter.new(entity).execute - end - - # A new BulkImportWorker job is enqueued to either - # - Process the new BulkImports::Entity created for the subgroups - # - Or to mark the `bulk_import` as finished. - BulkImportWorker.perform_async(bulk_import.id) - end - end - - private - - attr_reader :bulk_import - - def entities_to_import - @entities_to_import ||= bulk_import.entities.with_status(:created) - end - end - end -end |