2018-06-27 03:23:28 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 13:09:10 -05:00
|
|
|
class ProjectServiceWorker # rubocop:disable Scalability/IdempotentWorker
|
2017-11-28 11:08:30 -05:00
|
|
|
include ApplicationWorker
|
2014-12-07 05:29:37 -05:00
|
|
|
|
2017-07-17 11:38:02 -04:00
|
|
|
sidekiq_options dead: false
|
2019-10-18 07:11:44 -04:00
|
|
|
feature_category :integrations
|
2019-10-30 11:14:17 -04:00
|
|
|
worker_has_external_dependencies!
|
2017-07-17 11:38:02 -04:00
|
|
|
|
2014-12-07 05:29:37 -05:00
|
|
|
def perform(hook_id, data)
|
2014-12-29 10:48:43 -05:00
|
|
|
data = data.with_indifferent_access
|
2018-08-21 15:29:50 -04:00
|
|
|
service = Service.find(hook_id)
|
|
|
|
service.execute(data)
|
|
|
|
rescue => error
|
|
|
|
service_class = service&.class&.name || "Not Found"
|
|
|
|
logger.error class: self.class.name, service_class: service_class, message: error.message
|
2014-12-07 05:29:37 -05:00
|
|
|
end
|
|
|
|
end
|