diff options
author | Jeroen Nijhof <jeroen@jeroennijhof.nl> | 2016-01-20 11:48:38 +0300 |
---|---|---|
committer | Jeroen Nijhof <jeroen@jeroennijhof.nl> | 2016-01-20 11:48:38 +0300 |
commit | 7a609858f063c1089f3a6ec05f9f87a01efa909a (patch) | |
tree | 4e303d01b16b819551ceb4cf5bbdf52284f30e37 /config/initializers/sentry.rb | |
parent | 7658a6446976b8fdb451ce53c8e1f0963ff1a8ec (diff) |
Use sentry in env production only
Diffstat (limited to 'config/initializers/sentry.rb')
-rw-r--r-- | config/initializers/sentry.rb | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index 3ef46291981..d0630b9fa07 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -3,15 +3,17 @@ require 'gitlab/current_settings' include Gitlab::CurrentSettings -# allow it to fail: it may do so when create_from_defaults is executed before migrations are actually done -begin - sentry_enabled = current_application_settings.sentry_enabled -rescue - sentry_enabled = false -end +if Rails.env.production? + # allow it to fail: it may do so when create_from_defaults is executed before migrations are actually done + begin + sentry_enabled = current_application_settings.sentry_enabled + rescue + sentry_enabled = false + end -if sentry_enabled - Raven.configure do |config| - config.dsn = current_application_settings.sentry_dsn + if sentry_enabled + Raven.configure do |config| + config.dsn = current_application_settings.sentry_dsn + end end end |