diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/workers/group_import_worker.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'app/workers/group_import_worker.rb')
-rw-r--r-- | app/workers/group_import_worker.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/workers/group_import_worker.rb b/app/workers/group_import_worker.rb index d8f236013bf..36d81468d55 100644 --- a/app/workers/group_import_worker.rb +++ b/app/workers/group_import_worker.rb @@ -9,15 +9,16 @@ class GroupImportWorker # rubocop:disable Scalability/IdempotentWorker 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_state = group.import_state || group.build_import_state - group_import.start! + group_import_state.jid = self.jid + group_import_state.start! ::Groups::ImportExport::ImportService.new(group: group, user: current_user).execute - group_import.finish! + group_import_state.finish! rescue StandardError => e - group_import&.fail_op(e.message) + group_import_state&.fail_op(e.message) raise e end |