summaryrefslogtreecommitdiff
path: root/app/services/groups/import_export/export_service.rb
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.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/services/groups/import_export/export_service.rb b/app/services/groups/import_export/export_service.rb
index 0bf54844430..86e2eeda21f 100644
--- a/app/services/groups/import_export/export_service.rb
+++ b/app/services/groups/import_export/export_service.rb
@@ -10,9 +10,15 @@ module Groups
@shared = @params[:shared] || Gitlab::ImportExport::Shared.new(@group)
end
+ def async_execute
+ GroupExportWorker.perform_async(@current_user.id, @group.id, @params)
+ end
+
def execute
validate_user_permissions
+ remove_existing_export! if @group.export_file_exists?
+
save!
ensure
cleanup
@@ -30,6 +36,13 @@ module Groups
end
end
+ def remove_existing_export!
+ import_export_upload = @group.import_export_upload
+
+ import_export_upload.remove_export_file!
+ import_export_upload.save
+ end
+
def save!
if savers.all?(&:save)
notify_success