2016-01-22 14:13:37 -05:00
|
|
|
class ProjectDestroyWorker
|
|
|
|
include Sidekiq::Worker
|
2016-10-21 12:13:41 -04:00
|
|
|
include DedicatedSidekiqQueue
|
2016-01-22 14:13:37 -05:00
|
|
|
|
|
|
|
def perform(project_id, user_id, params)
|
2017-06-29 07:43:01 -04:00
|
|
|
project = Project.find(project_id)
|
2016-01-22 14:13:37 -05:00
|
|
|
user = User.find(user_id)
|
|
|
|
|
2016-08-03 19:45:06 -04:00
|
|
|
::Projects::DestroyService.new(project, user, params.symbolize_keys).execute
|
2017-07-06 09:43:07 -04:00
|
|
|
rescue ActiveRecord::RecordNotFound => error
|
2017-07-18 11:09:14 -04:00
|
|
|
logger.error("Failed to delete project (#{project_id}): #{error.message}")
|
2016-01-22 14:13:37 -05:00
|
|
|
end
|
|
|
|
end
|