2016-01-22 14:13:37 -05:00
|
|
|
class ProjectDestroyWorker
|
2017-11-28 11:08:30 -05:00
|
|
|
include ApplicationWorker
|
2017-08-24 15:24:58 -04:00
|
|
|
include ExceptionBacktrace
|
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
|