File tree 3 files changed +13
-0
lines changed 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 35
35
end
36
36
` ` `
37
37
38
+ - Pick up config.cron.default_timezone from Rails config ([# 2213](https://github.com/getsentry/sentry-ruby/pull/2213))
39
+
38
40
# # 5.15.2
39
41
40
42
# ## Bug Fixes
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ class Railtie < ::Rails::Railtie
40
40
41
41
configure_project_root
42
42
configure_trusted_proxies
43
+ configure_cron_timezone
43
44
extend_controller_methods if defined? ( ActionController )
44
45
patch_background_worker if defined? ( ActiveRecord )
45
46
override_streaming_reporter if defined? ( ActionView )
@@ -70,6 +71,11 @@ def configure_trusted_proxies
70
71
Sentry . configuration . trusted_proxies += Array ( ::Rails . application . config . action_dispatch . trusted_proxies )
71
72
end
72
73
74
+ def configure_cron_timezone
75
+ tz_info = ::ActiveSupport ::TimeZone . find_tzinfo ( ::Rails . application . config . time_zone )
76
+ Sentry . configuration . cron . default_timezone = tz_info . name
77
+ end
78
+
73
79
def extend_controller_methods
74
80
require "sentry/rails/controller_methods"
75
81
require "sentry/rails/controller_transaction"
Original file line number Diff line number Diff line change 26
26
expect ( app . middleware . find_index ( Sentry ::Rails ::RescuedExceptionInterceptor ) ) . to eq ( index_of_debug_exceptions + 1 )
27
27
end
28
28
29
+ it "propagates timezone to cron config" do
30
+ # cron.default_timezone is set to nil by default
31
+ expect ( Sentry . configuration . cron . default_timezone ) . to eq ( "Etc/UTC" )
32
+ end
33
+
29
34
it "inserts a callback to disable background_worker for the runner mode" do
30
35
Sentry . configuration . background_worker_threads = 10
31
36
You can’t perform that action at this time.
0 commit comments