Explorar o código

定时区间修改

liweiquan %!s(int64=2) %!d(string=hai) anos
pai
achega
c787bc7f79
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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):