@@ -52,7 +52,9 @@ def monitor_for(task, job)
5252 return unless slug
5353
5454 config = Sentry ::Cron ::FugitSchedule . from_cron ( cron_for ( task ) )
55- { "slug" => slug , "crontab" => config &.schedule &.value , "timezone" => config &.timezone } . compact
55+ return unless config
56+
57+ { "slug" => slug , "crontab" => config . schedule . value , "timezone" => config . timezone } . compact
5658 rescue StandardError => e
5759 Sentry . sdk_logger . error ( Sentry ::LOGGER_PROGNAME ) { "Not monitoring Solid Queue recurring task #{ task . key } : #{ e . class } : #{ e . message } " }
5860 nil
@@ -62,18 +64,17 @@ def perform(job)
6264 data = job . instance_variable_get ( :@_sentry_recurring_task )
6365 return yield unless data && Sentry . initialized?
6466
65- slug = data [ "slug" ]
66- if data [ "crontab" ]
67- cron_config = Sentry . configuration . cron
68- monitor_config = Sentry ::Cron ::MonitorConfig . from_crontab (
69- data [ "crontab" ] ,
70- timezone : data [ "timezone" ] ,
71- checkin_margin : cron_config . default_checkin_margin ,
72- max_runtime : cron_config . default_max_runtime
73- )
74- end
67+ return yield unless data [ "crontab" ]
68+
69+ cron_config = Sentry . configuration . cron
70+ monitor_config = Sentry ::Cron ::MonitorConfig . from_crontab (
71+ data [ "crontab" ] ,
72+ timezone : data [ "timezone" ] ,
73+ checkin_margin : cron_config . default_checkin_margin ,
74+ max_runtime : cron_config . default_max_runtime
75+ )
7576
76- Sentry ::Cron ::MonitorCheckIns . with_check_in ( slug , monitor_config : monitor_config ) { yield }
77+ Sentry ::Cron ::MonitorCheckIns . with_check_in ( data [ " slug" ] , monitor_config : monitor_config ) { yield }
7778 end
7879
7980 def patch
0 commit comments