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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/groups/import_export/export_service.rb')
-rw-r--r--app/services/groups/import_export/export_service.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/app/services/groups/import_export/export_service.rb b/app/services/groups/import_export/export_service.rb
index 2c3975961a8..aa484e7203c 100644
--- a/app/services/groups/import_export/export_service.rb
+++ b/app/services/groups/import_export/export_service.rb
@@ -18,6 +18,8 @@ module Groups
end
save!
+ ensure
+ cleanup
end
private
@@ -28,7 +30,7 @@ module Groups
if savers.all?(&:save)
notify_success
else
- cleanup_and_notify_error!
+ notify_error!
end
end
@@ -37,21 +39,19 @@ module Groups
end
def tree_exporter
- Gitlab::ImportExport::GroupTreeSaver.new(group: @group, current_user: @current_user, shared: @shared, params: @params)
+ Gitlab::ImportExport::Group::TreeSaver.new(group: @group, current_user: @current_user, shared: @shared, params: @params)
end
def file_saver
Gitlab::ImportExport::Saver.new(exportable: @group, shared: @shared)
end
- def cleanup_and_notify_error
- FileUtils.rm_rf(shared.export_path)
-
- notify_error
+ def cleanup
+ FileUtils.rm_rf(shared.archive_path) if shared&.archive_path
end
- def cleanup_and_notify_error!
- cleanup_and_notify_error
+ def notify_error!
+ notify_error
raise Gitlab::ImportExport::Error.new(shared.errors.to_sentence)
end