Sha256: e5528ef2e86a1292604005702fbb74c6780d811ec6e4829b5611c1e5afc3a69c

Contents?: true

Size: 439 Bytes

Versions: 2

Compression:

Stored size: 439 Bytes

Contents

require 'sidekiq'

module YogiBerra
  class Sidekiq
    def call(worker, message, queue)
      begin
        yield
      rescue Exception => exception
        message["worker"] = message.delete("jid")
        YogiBerra.exceptionize(exception, :sidekiq => message)
        raise exception
      end
    end
  end
end

::Sidekiq.configure_server do |config|
  config.server_middleware do |chain|
    chain.add ::YogiBerra::Sidekiq
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yogi_berra-0.2.1 lib/yogi_berra/sidekiq.rb
yogi_berra-0.2.0 lib/yogi_berra/sidekiq.rb