fix: 网关限流系统配置 Key 改为三段式,修复注册失败
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m35s

- 受控系统配置要求 Key 至少三段,原两段式 Key(如 polling.rate_limit_mode)注册被拒,后台不可见、限流器只能使用默认值
- Key 改为 polling.gateway.* 与 polling.stop_resume_record.*;新增迁移 000247 将已落库的旧 Key 改名并保留取值
- 后续提案中规划的开关同步改为三段式(polling.scheduler.mode、polling.stop_resume.queue_enabled)
This commit is contained in:
邹进
2026-10-24 16:17:34 +09:00
parent 9b0930db9f
commit 02a842f066
16 changed files with 70 additions and 34 deletions

View File

@@ -59,7 +59,7 @@
### Requirement: 只统计与拦截两种模式
系统 SHALL 按受控系统配置 `polling.rate_limit_mode` 全局决定限流模式:`observe` 时照常计数(实际 QPS、本应被拦截的次数)但不拦截、不等待;`enforce` 时按限流组拦截。默认值 MUST 为 `observe`。模式修改 MUST 即时生效,不需要重新部署。模式不得按运营商账户覆盖。
系统 SHALL 按受控系统配置 `polling.gateway.rate_limit_mode` 全局决定限流模式:`observe` 时照常计数(实际 QPS、本应被拦截的次数)但不拦截、不等待;`enforce` 时按限流组拦截。默认值 MUST 为 `observe`。模式修改 MUST 即时生效,不需要重新部署。模式不得按运营商账户覆盖。
#### Scenario: 只统计模式下超出上限
- **GIVEN** 模式为 `observe`,账户 A 查询组本秒已达上限
@@ -67,7 +67,7 @@
- **THEN** 系统照常发出请求,并把该次计入"本应被限流"次数
#### Scenario: 切换为拦截
- **WHEN** 超级管理员把 `polling.rate_limit_mode` 改为 `enforce`
- **WHEN** 超级管理员把 `polling.gateway.rate_limit_mode` 改为 `enforce`
- **THEN** 下一次请求起按限流组拦截,无需重启进程
### Requirement: Asynq 任务内遇限流不等待且不计失败