summaryrefslogtreecommitdiff
path: root/app/controllers/projects/settings/repository_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/settings/repository_controller.rb')
-rw-r--r--app/controllers/projects/settings/repository_controller.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/controllers/projects/settings/repository_controller.rb b/app/controllers/projects/settings/repository_controller.rb
index 0994bebb1d0..dd50ab1bc7a 100644
--- a/app/controllers/projects/settings/repository_controller.rb
+++ b/app/controllers/projects/settings/repository_controller.rb
@@ -18,14 +18,13 @@ module Projects
end
def cleanup
- cleanup_params = params.require(:project).permit(:bfg_object_map)
- result = Projects::UpdateService.new(project, current_user, cleanup_params).execute
+ bfg_object_map = params.require(:project).require(:bfg_object_map)
+ result = Projects::CleanupService.enqueue(project, current_user, bfg_object_map)
if result[:status] == :success
- RepositoryCleanupWorker.perform_async(project.id, current_user.id) # rubocop:disable CodeReuse/Worker
flash[:notice] = _('Repository cleanup has started. You will receive an email once the cleanup operation is complete.')
else
- flash[:alert] = _('Failed to upload object map file')
+ flash[:alert] = status.fetch(:message, _('Failed to upload object map file'))
end
redirect_to project_settings_repository_path(project)