fix: 修复validate_second_or_minute参数丢失的问题
This commit is contained in:
@@ -40,7 +40,7 @@ class CronUtil:
|
|||||||
if (
|
if (
|
||||||
second_or_minute == '*'
|
second_or_minute == '*'
|
||||||
or ('-' in second_or_minute and cls.__valid_range(second_or_minute, 0, 59))
|
or ('-' in second_or_minute and cls.__valid_range(second_or_minute, 0, 59))
|
||||||
or ('/' in second_or_minute and cls.__valid_sum(second_or_minute, 0, 58, 1, 59))
|
or ('/' in second_or_minute and cls.__valid_sum(second_or_minute, 0, 58, 1, 59, 59))
|
||||||
or re.match(r'^(?:[0-5]?\d|59)(?:,[0-5]?\d|59)*$', second_or_minute)
|
or re.match(r'^(?:[0-5]?\d|59)(?:,[0-5]?\d|59)*$', second_or_minute)
|
||||||
):
|
):
|
||||||
return True
|
return True
|
||||||
@@ -109,8 +109,8 @@ class CronUtil:
|
|||||||
if (
|
if (
|
||||||
week in ['*', '?']
|
week in ['*', '?']
|
||||||
or ('-' in week and cls.__valid_range(week, 1, 7))
|
or ('-' in week and cls.__valid_range(week, 1, 7))
|
||||||
or re.match(r'^[1-7]#[1-4]$', week)
|
or ('#' in week and re.match(r'^[1-7]#[1-4]$', week))
|
||||||
or re.match(r'^[1-7]L$', week)
|
or ('L' in week and re.match(r'^[1-7]L$', week))
|
||||||
or re.match(r'^[1-7](?:(,[1-7]))*$', week)
|
or re.match(r'^[1-7](?:(,[1-7]))*$', week)
|
||||||
):
|
):
|
||||||
return True
|
return True
|
||||||
@@ -130,8 +130,8 @@ class CronUtil:
|
|||||||
year == '*'
|
year == '*'
|
||||||
or ('-' in year and cls.__valid_range(year, current_year, 2099))
|
or ('-' in year and cls.__valid_range(year, current_year, 2099))
|
||||||
or ('/' in year and cls.__valid_sum(year, current_year, 2098, 1, 2099 - current_year, 2099))
|
or ('/' in year and cls.__valid_sum(year, current_year, 2098, 1, 2099 - current_year, 2099))
|
||||||
or re.match(r'^[1-7]#[1-4]$', year)
|
or ('#' in year and re.match(r'^[1-7]#[1-4]$', year))
|
||||||
or re.match(r'^[1-7]L$', year)
|
or ('L' in year and re.match(r'^[1-7]L$', year))
|
||||||
or (
|
or (
|
||||||
(len(year) == 4 or ',' in year)
|
(len(year) == 4 or ',' in year)
|
||||||
and all(int(item) in future_years and current_year <= int(item) <= 2099 for item in year.split(','))
|
and all(int(item) in future_years and current_year <= int(item) <= 2099 for item in year.split(','))
|
||||||
|
Reference in New Issue
Block a user