Browse Source

定时规则修改

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

+ 2 - 2
app/utils/cron_utils.py

@@ -64,8 +64,8 @@ def check_cron_expression(cron_expression):
     cron_list = cron_expression.split(' ')
     unit_list = ['minute', 'hour', 'day', 'month', 'week']
     reg_list = [
-        "^((([0-9]|[0-5][0-9])(\\,|\\-|\\/){1}([0-9]|[0-5][0-9]))|([0-9]|[0-5][0-9])|(\\*))$",
-        "^((([0-9]|[1][0-9]|2[0-3])(\\,|\\-|\\/){1}([0-9]|[1][0-9]|2[0-3]))|([0-9]|[1][0-9]|2[0-3])|(\\*))$",
+        "^((([0-9]|[1-5][0-9])(\\,|\\-|\\/){1}([1-9]|[1-5][0-9]))|([0-9]|[0-5][0-9])|(\\*))$",
+        "^((([0-9]|[1][0-9]|2[0-3])(\\,|\\-|\\/){1}([1-9]|[1][0-9]|2[0-3]))|([0-9]|[1][0-9]|2[0-3])|(\\*))$",
         "^((([1-9]|[1-2][0-9]|3[01])(\\,|\\-|\\/){1}([1-9]|[1-2][0-9]|3[01]))|([1-9]|[1-2][0-9]|3[01])|(\\*)|(\\?))$",
         "^((([1-9]|[1][0-2])(\\,|\\-|\\/){1}([1-9]|[1][0-2]))|([1-9]|[1][0-2])|(\\*))$",
         "^((([1-7])(\\,|\\-|\\/){1}([1-7]))|([1-7])|(\\*)|(\\?))$"