Skip to content

Instantly share code, notes, and snippets.

@nateberkopec
Created November 21, 2012 22:31
Show Gist options
  • Save nateberkopec/4128288 to your computer and use it in GitHub Desktop.
Save nateberkopec/4128288 to your computer and use it in GitHub Desktop.
# how can I change this middleware to only call Raven.captureException when a message is placed in the retries queue, let's say, for the third time?
module Raven
class Sidekiq
def call(worker, msg, queue)
begin
yield
rescue => ex
Raven.captureException(ex)
raise
end
end
end
end
::Sidekiq.configure_server do |config|
config.server_middleware do |chain|
chain.add ::Raven::Sidekiq
end
end
@mperham
Copy link

mperham commented Nov 21, 2012

Are you referring to the transactional issue where Sidekiq tries to find data that hasn't committed yet?

@mperham
Copy link

mperham commented Nov 21, 2012

That issue is covered in the FAQ, use an after_commit callback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment