gitlab-org--gitlab-foss/app/workers/project_destroy_worker.rb
Stan Hu 443ae8c4e6 Fix skip_repo parameter being ignored when destroying a namespace
When destroying a namespace, the `skip_repo` parameter is supposed
to prevent the repository directory from being destroyed and allow
the namespace after_destroy hook to run. If the namespace fails
to be deleted for some reason, we could be left with repositories
that are deleted with existing projects.
2016-08-03 17:07:38 -07:00

17 lines
376 B
Ruby

class ProjectDestroyWorker
include Sidekiq::Worker
sidekiq_options queue: :default
def perform(project_id, user_id, params)
begin
project = Project.unscoped.find(project_id)
rescue ActiveRecord::RecordNotFound
return
end
user = User.find(user_id)
::Projects::DestroyService.new(project, user, params.symbolize_keys).execute
end
end