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