-
Notifications
You must be signed in to change notification settings - Fork 173
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
Sidekiq improvements #317
Sidekiq improvements #317
Conversation
@@ -51,7 +49,7 @@ class Railtie < Rails::Railtie | |||
ActiveRecord::Base.send(:include, Bugsnag::Rails::ActiveRecordRescue) | |||
end | |||
|
|||
Bugsnag.configuration.app_type = "rails" unless Bugsnag::Railtie.running_as_dependency | |||
Bugsnag.configuration.app_type = "rails" |
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 change relies on the fact that in the other cases (sidekiq etc) we know that we are running in that env. This is definitely a little broad, but I think its OK. This will ultimately be set to rails in the console and in the server case, which is what we want.
It is also initially set to rails in other apps (for example in a sidekiq app that also has rails) but because we later know we are running in a sidekiq app, we change the app_type then to be sidekiq.
I think this also fixes some bugs with app_type detection and adds some example apps for testing/demo purposes. |
LGTM |
@@ -37,4 +37,6 @@ def save | |||
# Auto-load the failure backend | |||
Bugsnag::Resque.add_failure_backend | |||
|
|||
Bugsnag.configuration.app_type = "resque" | |||
Resque.before_first_fork do | |||
Bugsnag.configuration.app_type = "resque" |
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.
Here I should also add synchronous delivery mechanism
Bugsnag.configuration.app_type = "resque" | ||
Resque.before_first_fork do | ||
Bugsnag.configuration.app_type = "resque" | ||
Bugsnag.configuration.delivery_method = :synchronous |
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.
Why is this setting synchronous? How does we override this value in resque workers if we don't want it?
Fixes #282, #309, #306