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