mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 17:30:23 +08:00
fix(providers): 允许 max_probe_interval_minutes 设为 0 并修复零值被覆盖的问题
- 将 max_probe_interval_minutes 校验范围从 2-32 改为 0-32 - 修复 routes.py 中 max_probe_interval_minutes 和 cache_ttl_minutes 使用 `or` 短路导致零值被默认值覆盖的问题,改用 is not None 判断 - 前端表单同步调整最小值约束和提示文案 - 新增零值校验的单元测试
This commit is contained in:
@@ -846,9 +846,13 @@ class AdminListPoolKeysAdapter(AdminApiAdapter):
|
||||
rate_multipliers=rate_multipliers,
|
||||
internal_priority=int(getattr(k, "internal_priority", 50) or 50),
|
||||
rpm_limit=getattr(k, "rpm_limit", None),
|
||||
cache_ttl_minutes=int(getattr(k, "cache_ttl_minutes", 5) or 5),
|
||||
max_probe_interval_minutes=int(
|
||||
getattr(k, "max_probe_interval_minutes", 32) or 32
|
||||
cache_ttl_minutes=(
|
||||
v if (v := getattr(k, "cache_ttl_minutes", None)) is not None else 5
|
||||
),
|
||||
max_probe_interval_minutes=(
|
||||
v
|
||||
if (v := getattr(k, "max_probe_interval_minutes", None)) is not None
|
||||
else 32
|
||||
),
|
||||
note=getattr(k, "note", None),
|
||||
allowed_models=allowed_models,
|
||||
|
||||
Reference in New Issue
Block a user