mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-10 19:29:50 +08:00
fix(gateway): 对齐号池调度预设行为 (#332)
- 保持 sticky session 优先于分配模式排序,并支持 sticky_session_ttl_seconds=0 禁用粘滞绑定 - 移除旧版 free_team_first 预设入口,统一使用 free_first / team_first 新模式 - 对齐 plus_first 对 Plus/Pro 账号的优先级处理 - 调整负载均衡排序种子,避免同一分钟内固定命中同一 Key - multi-score 预设下记录延迟样本,并补充号池调度/配置/运行时测试 - 收敛 request candidate extra_data 构造入参,修复 clippy too_many_arguments
This commit is contained in:
@@ -266,7 +266,6 @@ pub(crate) fn admin_provider_pool_config_from_config_value(
|
||||
sticky_session_ttl_seconds: pool_advanced
|
||||
.get("sticky_session_ttl_seconds")
|
||||
.and_then(json_u64)
|
||||
.filter(|value| *value > 0)
|
||||
.unwrap_or(3600),
|
||||
latency_window_seconds: pool_advanced
|
||||
.get("latency_window_seconds")
|
||||
@@ -389,6 +388,18 @@ mod tests {
|
||||
assert_eq!(config.stream_timeout_cooldown_seconds, 180);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parses_zero_sticky_session_ttl_to_disable_sticky_sessions() {
|
||||
let config = admin_provider_pool_config_from_config_value(Some(&json!({
|
||||
"pool_advanced": {
|
||||
"sticky_session_ttl_seconds": 0
|
||||
}
|
||||
})))
|
||||
.expect("pool config should parse");
|
||||
|
||||
assert_eq!(config.sticky_session_ttl_seconds, 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parses_pool_config_from_generic_config_value() {
|
||||
let config = admin_provider_pool_config_from_config_value(Some(&json!({
|
||||
|
||||
Reference in New Issue
Block a user