2018-11-08 19:23:39 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
class FileHookWorker # rubocop:disable Scalability/IdempotentWorker
|
2018-03-27 19:54:05 +05:30
|
|
|
include ApplicationWorker
|
|
|
|
|
|
|
|
sidekiq_options retry: false
|
2019-12-21 20:55:43 +05:30
|
|
|
feature_category :integrations
|
2018-03-27 19:54:05 +05:30
|
|
|
|
|
|
|
def perform(file_name, data)
|
2020-03-09 13:42:32 +05:30
|
|
|
success, message = Gitlab::FileHook.execute(file_name, data)
|
2018-03-27 19:54:05 +05:30
|
|
|
|
|
|
|
unless success
|
2020-03-09 13:42:32 +05:30
|
|
|
Gitlab::FileHookLogger.error("File Hook Error => #{file_name}: #{message}")
|
2018-03-27 19:54:05 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|