gitlab-org--gitlab-foss/app/services/projects/destroy_service.rb
2014-06-17 22:20:10 +03:00

27 lines
699 B
Ruby

module Projects
class UpdateService < BaseService
def execute(role = :default)
return false unless can?(current_user, :remove_project, project)
project.repository.expire_cache unless project.empty_repo?
if project.destroy
GitlabShellWorker.perform_async(
:remove_repository,
project.path_with_namespace
)
GitlabShellWorker.perform_async(
:remove_repository,
project.path_with_namespace + ".wiki"
)
project.satellite.destroy
log_info("Project \"#{project.name}\" was removed")
system_hook_service.execute_hooks_for(project, :destroy)
true
end
end
end
end