Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pierrickouw/da5fb6bffda2b17ab50d427ade1beb83 to your computer and use it in GitHub Desktop.
Save pierrickouw/da5fb6bffda2b17ab50d427ade1beb83 to your computer and use it in GitHub Desktop.
ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper.define_method(:sidekiq_retry_in_block) do
lambda do |count, exception, jobhash|
wrapped_class = jobhash['wrapped']&.safe_constantize
if wrapped_class.method_defined?(:sidekiq_retry_in_block)
return wrapped_class.sidekiq_retry_in_block&.call(count, exception, jobhash)
end
nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment