Browse Source

时间检验转int

liweiquan 2 years ago
parent
commit
a9fc50a9d7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/utils/cron_utils.py

+ 1 - 1
app/utils/cron_utils.py

@@ -113,7 +113,7 @@ def check_cron_hour(cron_expression):
     unit_list = ['minute', 'hour', 'day', 'month', 'week']
     for cron, unit in zip(cron_list, unit_list):
         if unit == 'hour':
-            if int(cron) < hour_min or int(cron) > hour_max:
+            if int(cron) < int(hour_min) or int(cron) > int(hour_max):
                 raise Exception(f'执行时间必须在每日{hour_min}~{hour_max}时之间')
 
 def run_get_next_time(cron_expression):