Skip to content

Commit

Permalink
Merge pull request #652 from isabanin/patch-1
Browse files Browse the repository at this point in the history
Bugsnag gem crashes when used with an older mongo gem (1.12)
  • Loading branch information
imjoehaines authored Mar 26, 2021
2 parents 3573dc0 + db93f53 commit 5f0e0ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/bugsnag/integrations/mongo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ def event_commands
end
end

##
# Add the subscriber to the global Mongo monitoring object
Mongo::Monitoring::Global.subscribe(Mongo::Monitoring::COMMAND, Bugsnag::MongoBreadcrumbSubscriber.new)
if defined?(Mongo::Monitoring)
##
# Add the subscriber to the global Mongo monitoring object
Mongo::Monitoring::Global.subscribe(Mongo::Monitoring::COMMAND, Bugsnag::MongoBreadcrumbSubscriber.new)
end

0 comments on commit 5f0e0ea

Please sign in to comment.