lib/sentry/rails/railtie.rb in sentry-rails-5.15.2 vs lib/sentry/rails/railtie.rb in sentry-rails-5.16.1
- old
+ new
@@ -38,10 +38,11 @@
config.after_initialize do |app|
next unless Sentry.initialized?
configure_project_root
configure_trusted_proxies
+ configure_cron_timezone
extend_controller_methods if defined?(ActionController)
patch_background_worker if defined?(ActiveRecord)
override_streaming_reporter if defined?(ActionView)
setup_backtrace_cleanup_callback
inject_breadcrumbs_logger
@@ -66,9 +67,14 @@
Sentry.configuration.project_root = ::Rails.root.to_s
end
def configure_trusted_proxies
Sentry.configuration.trusted_proxies += Array(::Rails.application.config.action_dispatch.trusted_proxies)
+ end
+
+ def configure_cron_timezone
+ tz_info = ::ActiveSupport::TimeZone.find_tzinfo(::Rails.application.config.time_zone)
+ Sentry.configuration.cron.default_timezone = tz_info.name
end
def extend_controller_methods
require "sentry/rails/controller_methods"
require "sentry/rails/controller_transaction"