-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make code compatible with mongo ruby driver >= 2.0.0 #7
Conversation
rescue => e | ||
@logger.warn("Failed to send event to MongoDB", :event => event, :exception => e, | ||
:backtrace => e.backtrace) | ||
if e.error_code == 11000 | ||
if e.message =~ /^11000/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be /^E11000/
Here's a snippet of the error: :exception=>#<Mongo::Error::OperationFailure: E11000 duplicate key error...
+1 after the fix for the duplicate key error |
@coreypobrien thanks for spotting the typo. I'm confused does it work for you or not ? |
Yeah it works for me except for the duplicate record error which just sends things into an infinite loop of retry hell :) Sorry about the confusing comment. I edited it to be clearer |
No worries mate. |
Thanks a lot for your contribution @thikonom. To be able to go forward with this PR it would be necessary that you sign the CLA (https://www.elastic.co/contributor-agreement). Looking forward to get this in,
|
Hey @purbon, I just signed it. |
I made some changes to make the code compatible with the new version of the mongo driver (>= 2.0.0).