gitlab-org--gitlab-foss/app/workers/system_hook_worker.rb
Drew Blessing 354e37b869 Add retry to system hook worker
The default number of Sidekiq retries is 25 over about 21 days.
If an external system is unavailable for a length of time, hooks
can pile up in the Sidekiq queues. If the situation gets bad enough
the retry jobs dropping back into the main queue can slow down
other jobs. Limit the retries to a sane number to avoid this
scenario.
2017-04-19 16:44:49 -05:00

10 lines
214 B
Ruby

class SystemHookWorker
include Sidekiq::Worker
include DedicatedSidekiqQueue
sidekiq_options retry: 4
def perform(hook_id, data, hook_name)
SystemHook.find(hook_id).execute(data, hook_name)
end
end