Created
November 21, 2012 22:31
-
-
Save nateberkopec/4128288 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Are you referring to the transactional issue where Sidekiq tries to find data that hasn't committed yet?
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
Currently, most of the bug-tracking middlewares are really set up to notify the exception tracker on every exception. because of the way sidekiq is made, sometimes sidekiq is a little eager, starts before the database is done, and then works on the first retry. Is there any way to code this middleware so that I notify the exception tracker on the "nth" retry?