Browse Source

定时区间修改

liweiquan 2 years ago
parent
commit
c787bc7f79
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) < int(hour_min) or int(cron) > int(hour_max):
+            if int(cron) < int(hour_min) or int(cron) > int(hour_max)-1:
                 raise Exception(f'执行时间必须在每日{hour_min}~{hour_max}时之间')
 
 def run_get_next_time(cron_expression):