Use GitlabShellWorker.perform_async for housekeeping

This commit is contained in:
Jeroen Nijhof 2015-11-19 16:04:07 +01:00
parent 839aae0e47
commit d4690af8bc
2 changed files with 3 additions and 7 deletions

View File

@ -172,14 +172,10 @@ class ProjectsController < ApplicationController
end
def housekeeping
status = ::Projects::HousekeepingService.new(@project).execute
::Projects::HousekeepingService.new(@project).execute
respond_to do |format|
if status
flash[:notice] = "Housekeeping finished successfully."
else
flash[:alert] = "Housekeeping failed."
end
flash[:notice] = "Housekeeping successfully started."
format.html { redirect_to project_path(@project) }
end
end

View File

@ -14,7 +14,7 @@ module Projects
end
def execute
gitlab_shell.gc(@project.path_with_namespace)
GitlabShellWorker.perform_async(:gc, @project.path_with_namespace)
end
end
end