Skip to content

Commit

Permalink
[resque] Avoid leaking config in parent process (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
kattrali authored Feb 17, 2017
2 parents 92ab3a2 + 091704a commit 2ec3718
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/bugsnag/resque.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ def save
# Auto-load the failure backend
Bugsnag::Resque.add_failure_backend

Resque.before_first_fork do
Bugsnag.configuration.app_type = "resque"
Bugsnag.configuration.default_delivery_method = :synchronous
if Resque::Worker.new.fork_per_job?
Resque.after_fork do
Bugsnag.configuration.app_type = "resque"
Bugsnag.configuration.default_delivery_method = :synchronous
end
else
Resque.before_first_fork do
Bugsnag.configuration.app_type = "resque"
Bugsnag.configuration.default_delivery_method = :synchronous
end
end

0 comments on commit 2ec3718

Please sign in to comment.