Skip to content

Commit

Permalink
use async? instead of asnyc
Browse files Browse the repository at this point in the history
  • Loading branch information
shime committed Aug 5, 2012
1 parent 7ae3f7e commit 4ed653b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/airbrake.rb
Expand Up @@ -29,6 +29,8 @@ module Airbrake
}


# Queue used to send async notices. Used only if configuration.async is
# set to true.
AIRBRAKE_QUEUE = GirlFriday::WorkQueue.new(nil,:size => 3) do |notice|
sender.send_to_airbrake(notice.to_xml)
end
Expand Down Expand Up @@ -137,7 +139,7 @@ def build_lookup_hash_for(exception, options = {})

def send_notice(notice)
if configuration.public?
if configuration.async
if configuration.async?
AIRBRAKE_QUEUE << notice
else
sender.send_to_airbrake(notice.to_xml)
Expand Down
1 change: 1 addition & 0 deletions lib/airbrake/configuration.rb
Expand Up @@ -135,6 +135,7 @@ class Configuration

alias_method :secure?, :secure
alias_method :use_system_ssl_cert_chain?, :use_system_ssl_cert_chain
alias_method :async?, :async

def initialize
@secure = false
Expand Down
2 changes: 1 addition & 1 deletion test/notifier_test.rb
Expand Up @@ -157,7 +157,7 @@ def set_development_env
config_opts = { 'one' => 'two', 'three' => 'four' }
notice = stub_notice!
stub_sender!
Airbrake.configuration = stub('config', :merge => config_opts, :public? => true)
Airbrake.configuration = stub('config', :merge => config_opts, :public? => true,:async? => nil)

Airbrake.notify(exception)

Expand Down

0 comments on commit 4ed653b

Please sign in to comment.