mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 13:09:18 +08:00
don't try to load airbrake if there is no config for it
This commit is contained in:
parent
2115c36c84
commit
a0bdbe046a
2
Gemfile
2
Gemfile
|
@ -12,7 +12,7 @@ gem 'redcarpet', require: false
|
|||
gem 'activerecord-postgres-hstore'
|
||||
gem 'acts_as_paranoid'
|
||||
gem 'active_attr' # until we get ActiveModel::Model with Rails 4
|
||||
gem 'airbrake', '3.1.2' # errbit is broken with 3.1.3 for now
|
||||
gem 'airbrake', '3.1.2', require: false # errbit is broken with 3.1.3 for now
|
||||
gem 'clockwork', require: false
|
||||
gem 'em-redis'
|
||||
gem 'eventmachine'
|
||||
|
|
14
config/airbrake.rb.sample
Normal file
14
config/airbrake.rb.sample
Normal file
|
@ -0,0 +1,14 @@
|
|||
# Internally Dicourse uses Errbit for error logging,
|
||||
# you can to by setting up an instance and amending this file
|
||||
|
||||
Airbrake.configure do |config|
|
||||
config.api_key = 'YOUR API KEY'
|
||||
config.host = 'errors.example.com'
|
||||
config.port = 80
|
||||
config.secure = config.port == 443
|
||||
|
||||
|
||||
# IP Spoof errors can be ignored
|
||||
config.ignore << "ActionDispatch::RemoteIp::IpSpoofAttackError"
|
||||
end
|
||||
|
|
@ -33,12 +33,6 @@ Discourse::Application.configure do
|
|||
config.ember.ember_location = "#{Rails.root}/app/assets/javascripts/external/ember.js"
|
||||
config.handlebars.precompile = false
|
||||
|
||||
# a bit hacky but works
|
||||
config.after_initialize do
|
||||
config.middleware.delete Airbrake::UserInformer
|
||||
config.middleware.delete Airbrake::Rack
|
||||
end
|
||||
|
||||
config.action_mailer.delivery_method = :smtp
|
||||
config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
|
||||
config.action_mailer.raise_delivery_errors = true
|
||||
|
|
|
@ -12,7 +12,7 @@ if defined?(PhusionPassenger)
|
|||
if forked
|
||||
# We're in smart spawning mode.
|
||||
$redis = DiscourseRedis.new
|
||||
Discourse::Application.config.cache_store.reconnect# = DiscourseRedis.new_redis_store
|
||||
Discourse::Application.config.cache_store.reconnect
|
||||
else
|
||||
# We're in conservative spawning mode. We don't need to do anything.
|
||||
end
|
||||
|
|
3
config/initializers/airbrake.rb
Normal file
3
config/initializers/airbrake.rb
Normal file
|
@ -0,0 +1,3 @@
|
|||
if Rails.env.production? && File.exists?(Rails.root + '/config/airbrake.rb')
|
||||
require 'airbrake'
|
||||
end
|
Loading…
Reference in New Issue
Block a user