chore: more sanity check
All checks were successful
build / trigger-build-image (push) Successful in 11s

This commit is contained in:
张泊明518370910136 2025-06-19 07:18:28 -04:00
parent 4ae1907ad2
commit 8e3e61c37b
GPG Key ID: CA088E6D9284F870
2 changed files with 5 additions and 1 deletions

View File

@ -366,7 +366,11 @@ class Teapot:
time_windows = []
valid_items = []
for item in items:
if "=" not in item:
continue
name, values = item.split("=")
if ":" not in values:
continue
max_count, time_period = map(int, values.split(":"))
if max_count < 0 or time_period < 0:
continue

View File

@ -291,7 +291,7 @@ def get_title_prefix(
def parse_penalty_config(penalty_config: str) -> List[Tuple[float, float]]:
res = []
for penalty in penalty_config.split(","):
if not penalty.strip():
if "=" not in penalty:
continue
hour, factor = map(float, penalty.split("="))
res.append((hour, factor))