Skip to content

Commit

Permalink
Merge pull request #286 from Draiken/sidekiq_app_type_overwritten
Browse files Browse the repository at this point in the history
Ensure Sidekiq app_type is not overwritten when rails is a dependency
  • Loading branch information
kattrali committed Apr 4, 2016
2 parents b61c48c + 72389be commit b2f119d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/bugsnag/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

module Bugsnag
class Railtie < Rails::Railtie
cattr_accessor :running_as_dependency

rake_tasks do
require "bugsnag/rake"
load "bugsnag/tasks/bugsnag.rake"
Expand Down Expand Up @@ -49,7 +51,7 @@ class Railtie < Rails::Railtie
ActiveRecord::Base.send(:include, Bugsnag::Rails::ActiveRecordRescue)
end

Bugsnag.configuration.app_type = "rails"
Bugsnag.configuration.app_type = "rails" unless Bugsnag::Railtie.running_as_dependency
end

# Configure params_filters after initialization, so that rails initializers
Expand Down
4 changes: 4 additions & 0 deletions lib/bugsnag/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ def call(worker, msg, queue)

Bugsnag.configuration.internal_middleware.use(Bugsnag::Middleware::Sidekiq)
Bugsnag.configuration.app_type = "sidekiq"

if defined?(::Sidekiq::CLI) && defined?(Bugsnag::Railtie)
Bugsnag::Railtie.running_as_dependency = true
end

0 comments on commit b2f119d

Please sign in to comment.