fix(review): 代码审查 6 项修复(M2/M3/m1/m2/m3/m5)

集中修复 T8/T9/T11/T15 已实现代码的审查问题:
- M2 令牌桶 Lua 改用 Redis TIME(消除多节点时钟偏斜)
- M3 after 跨租户标记复查授权 + 无授权告警兜底
- m1 before 审计 MsgSeq/MsgRandom null 防御
- m2 HealthService 加 forceDown 开关,实测 DOWN 真返 503
- m3 countByStatus 排除 done(WHERE status IN (0,1,3))
- m5 配额查询异常不缓存(下次重试)
- 附带 app.yml console charset GBK→UTF-8
M1 限流审计/事务收窄暂缓。

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
yixiong
2026-07-09 09:52:13 +08:00
co-authored by Claude
parent 8e2c66b363
commit b4c6652f66
6 changed files with 45 additions and 16 deletions
@@ -156,10 +156,11 @@ public class TencentImClient {
if (t != null && t.getQuotaImQps() != null && t.getQuotaImQps() > 0) {
qps = t.getQuotaImQps();
}
// 仅查询成功才缓存(含"租户无配额配置→用默认");异常时不缓存,让下次重试
localCache.put(cacheKey, String.valueOf(qps));
} catch (Exception e) {
log.warn("查询租户配额失败 tenant={},用默认 {} : {}", tid, defaultImQps, e.getMessage());
log.warn("查询租户配额失败 tenant={},用默认 {}(不缓存,下次重试): {}", tid, defaultImQps, e.getMessage());
}
localCache.put(cacheKey, String.valueOf(qps));
return qps;
}