Skip to content
Extraits de code Groupes Projets
Valider ebfc3de8 rédigé par Jonne Haß's avatar Jonne Haß
Parcourir les fichiers

do not require newrelic or airbrake unless they are configured

parent 7fd606ba
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -28,8 +28,8 @@ gem 'messagebus_ruby_api', '1.0.1'
group :production do # we don't install these on travis to speed up test runs
# reporting
gem 'airbrake'
gem 'newrelic_rpm'
gem 'airbrake', :require => false
gem 'newrelic_rpm', :require => false
gem 'rack-google-analytics', :require => 'rack/google-analytics'
gem 'rack-piwik', :require => 'rack/piwik'
gem 'rack-ssl', :require => 'rack/ssl'
......
......@@ -76,6 +76,7 @@ HELP
normalize_pod_url
normalize_admins
normalize_pod_services
deprecate_hoptoad_api_key
end
def self.config_file_is_old_style?
......@@ -127,6 +128,13 @@ HELP
end
end
def deprecate_hoptoad_api_key
if self[:hoptoad_api_key].present?
$stderr.puts "WARNING: Please change hoptoad_api_key to airbrake_api_key in your application.yml"
self[:airbrake_api_key] = self[:hoptoad_api_key]
end
end
load!
def self.[] (key)
......
# Copyright (c) 2012, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
if AppConfig[:airbrake_api_key].present?
require 'airbrake'
Airbrake.configure do |config|
config.api_key = AppConfig[:airbrake_api_key]
end
end
# if old key still there, use it for new API,
# update application.yml to use airbrake_api_key instead
# (Former Hoptoad)
if AppConfig[:airbrake_api_key].present?
Airbrake.configure do |config|
config.api_key = AppConfig[:airbrake_api_key]
end
elsif AppConfig[:hoptoad_api_key].present?
puts "You're using old hoptoad_api_key, please update application.yml to use airbrake_api_key instead."
Airbrake.configure do |config|
config.api_key = AppConfig[:hoptoad_api_key]
end
end
# Copyright (c) 2012, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
if EnviromentConfiguration.using_new_relic?
require 'newrelic_rpm'
end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter