fix(adaptive): 修复 429 计数归零写入及 reset 语义

- sql.rs: UPDATE 时对 concurrent_429_count / rpm_429_count 加 COALESCE(, 0),避免 None 覆写为 NULL
- effects.rs: rpm_429_count 始终写入 Some(projection.rpm_429_count),不再过滤零值;新增 unknown-429 场景下零值持久化的单元测试
- adaptive.rs: reset 接口将两个计数字段置为 Some(0) 而非 None,与数据库默认语义对齐;同步修正集成测试断言
- docker-compose.build.yml: 补充 AETHER_GATEWAY_AUTO_PREPARE_DATABASE 默认开启
- README.md: 同步说明 build compose 也已默认开启自动迁移
This commit is contained in:
fawney19
2026-04-22 22:16:51 +08:00
parent c8d7dbd8d6
commit 4374f53315
6 changed files with 45 additions and 10 deletions

View File

@@ -134,8 +134,8 @@ impl<'a> AdminAppState<'a> {
return Ok(admin_adaptive_key_not_found_response(key_id));
};
key.learned_rpm_limit = None;
key.concurrent_429_count = None;
key.rpm_429_count = None;
key.concurrent_429_count = Some(0);
key.rpm_429_count = Some(0);
key.last_429_at_unix_secs = None;
key.last_429_type = None;
key.adjustment_history = None;