debian-mirror-gitlab/app/workers/file_hook_worker.rb

20 lines
442 B
Ruby
Raw Normal View History

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
2020-06-23 00:09:42 +05:30
loggable_arguments 0
2018-03-27 19:54:05 +05:30
def perform(file_name, data)
2020-03-13 15:44:24 +05:30
success, message = Gitlab::FileHook.execute(file_name, data)
2018-03-27 19:54:05 +05:30
unless success
2020-03-13 15:44:24 +05:30
Gitlab::FileHookLogger.error("File Hook Error => #{file_name}: #{message}")
2018-03-27 19:54:05 +05:30
end
true
end
end