@@ -69,31 +69,35 @@ defmodule Sentry.Integrations.Oban.Cron do
6969  end 
7070
7171  defp  job_to_check_in_opts ( job )  when  is_struct ( job ,  Oban.Job )  do 
72-     if  schedule_opts  =  schedule_opts ( job )  do 
73-       id  =  CheckInIDMappings . lookup_or_insert_new ( job . id ) 
74- 
75-       [ 
76-         check_in_id:  id , 
77-         # This is already a binary. 
78-         monitor_slug:  slugify ( job . worker ) , 
79-         monitor_config:  [ schedule:  schedule_opts ] 
80-       ] 
81-     else 
82-       nil 
72+     monitor_config_opts  =  Sentry.Config . integrations ( ) [ :monitor_config_defaults ] 
73+ 
74+     case  Keyword . merge ( monitor_config_opts ,  schedule_opts ( job ) )  do 
75+       [ ]  -> 
76+         nil 
77+ 
78+       monitor_config_opts  -> 
79+         id  =  CheckInIDMappings . lookup_or_insert_new ( job . id ) 
80+ 
81+         [ 
82+           check_in_id:  id , 
83+           # This is already a binary. 
84+           monitor_slug:  slugify ( job . worker ) , 
85+           monitor_config:  monitor_config_opts 
86+         ] 
8387    end 
8488  end 
8589
8690  defp  schedule_opts ( % { meta:  meta }  =  job )  when  is_struct ( job ,  Oban.Job )  do 
8791    case  meta [ "cron_expr" ]  do 
88-       "@hourly"  ->  [ type:  :interval ,  value:  1 ,  unit:  :hour ] 
89-       "@daily"  ->  [ type:  :interval ,  value:  1 ,  unit:  :day ] 
90-       "@weekly"  ->  [ type:  :interval ,  value:  1 ,  unit:  :week ] 
91-       "@monthly"  ->  [ type:  :interval ,  value:  1 ,  unit:  :month ] 
92-       "@yearly"  ->  [ type:  :interval ,  value:  1 ,  unit:  :year ] 
93-       "@annually"  ->  [ type:  :interval ,  value:  1 ,  unit:  :year ] 
94-       "@reboot"  ->  nil 
95-       cron_expr  when  is_binary ( cron_expr )  ->  [ type:  :crontab ,  value:  cron_expr ] 
96-       _other  ->  nil 
92+       "@hourly"  ->  [ schedule:  [ type:  :interval ,  value:  1 ,  unit:  :hour ] ] 
93+       "@daily"  ->  [ schedule:  [ type:  :interval ,  value:  1 ,  unit:  :day ] ] 
94+       "@weekly"  ->  [ schedule:  [ type:  :interval ,  value:  1 ,  unit:  :week ] ] 
95+       "@monthly"  ->  [ schedule:  [ type:  :interval ,  value:  1 ,  unit:  :month ] ] 
96+       "@yearly"  ->  [ schedule:  [ type:  :interval ,  value:  1 ,  unit:  :year ] ] 
97+       "@annually"  ->  [ schedule:  [ type:  :interval ,  value:  1 ,  unit:  :year ] ] 
98+       "@reboot"  ->  [ ] 
99+       cron_expr  when  is_binary ( cron_expr )  ->  [ schedule:  [ type:  :crontab ,  value:  cron_expr ] ] 
100+       _other  ->  [ ] 
97101    end 
98102  end 
99103
0 commit comments