2018-06-27 07:23:28 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 18:09:10 +00:00
|
|
|
class FileHookWorker # rubocop:disable Scalability/IdempotentWorker
|
2018-02-19 17:55:54 +00:00
|
|
|
include ApplicationWorker
|
|
|
|
|
|
|
|
sidekiq_options retry: false
|
2019-10-18 11:11:44 +00:00
|
|
|
feature_category :integrations
|
2020-06-12 12:08:56 +00:00
|
|
|
loggable_arguments 0
|
2018-02-19 17:55:54 +00:00
|
|
|
|
|
|
|
def perform(file_name, data)
|
2020-01-16 15:08:41 +00:00
|
|
|
success, message = Gitlab::FileHook.execute(file_name, data)
|
2018-02-28 10:16:23 +00:00
|
|
|
|
|
|
|
unless success
|
2020-01-16 15:08:41 +00:00
|
|
|
Gitlab::FileHookLogger.error("File Hook Error => #{file_name}: #{message}")
|
2018-02-28 10:16:23 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
true
|
2018-02-19 17:55:54 +00:00
|
|
|
end
|
|
|
|
end
|