2016-01-22 19:13:37 +00:00
|
|
|
class ProjectDestroyWorker
|
|
|
|
include Sidekiq::Worker
|
|
|
|
|
|
|
|
sidekiq_options queue: :default
|
|
|
|
|
|
|
|
def perform(project_id, user_id, params)
|
|
|
|
begin
|
2016-03-29 14:57:24 +00:00
|
|
|
project = Project.unscoped.find(project_id)
|
2016-01-22 19:13:37 +00:00
|
|
|
rescue ActiveRecord::RecordNotFound
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
user = User.find(user_id)
|
|
|
|
|
2016-08-03 23:45:06 +00:00
|
|
|
::Projects::DestroyService.new(project, user, params.symbolize_keys).execute
|
2016-01-22 19:13:37 +00:00
|
|
|
end
|
|
|
|
end
|