443ae8c4e6
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.
17 lines
376 B
Ruby
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
|