From 4ed653bcdef806336190427e63d35f3fef2002e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hrvoje=20=C5=A0imi=C4=87?= Date: Sun, 5 Aug 2012 23:33:25 +0200 Subject: [PATCH] use async? instead of asnyc --- lib/airbrake.rb | 4 +++- lib/airbrake/configuration.rb | 1 + test/notifier_test.rb | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/airbrake.rb b/lib/airbrake.rb index f320aeb4b..0a7707c91 100644 --- a/lib/airbrake.rb +++ b/lib/airbrake.rb @@ -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 @@ -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) diff --git a/lib/airbrake/configuration.rb b/lib/airbrake/configuration.rb index 62f48afd3..8dc39c184 100644 --- a/lib/airbrake/configuration.rb +++ b/lib/airbrake/configuration.rb @@ -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 diff --git a/test/notifier_test.rb b/test/notifier_test.rb index 964b5e2b5..8bb55a889 100644 --- a/test/notifier_test.rb +++ b/test/notifier_test.rb @@ -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)