2 Commits

Author SHA1 Message Date
xfy
f145a8770e refactor: modernize code with Go 1.22+ features
Apply modern Go patterns across the codebase:
- Replace `interface{}` with `any` (Go 1.18+)
- Use `for range n` instead of `for i := 0; i < n; i++` (Go 1.22+)
- Replace `sort.Slice` with `slices.Sort` from slices package
- Simplify sync.WaitGroup patterns with errgroup where appropriate
- Add Makefile targets for modernize analyzer

Total: 84 files updated, net reduction of 79 lines

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 10:37:45 +08:00
xfy
26a7a58265 feat(loadbalance): 实现慢启动功能
- 添加 SlowStartManager 统一管理目标慢启动状态
- Target 新增 EffectiveWeight 和 SlowStart 字段
- 实现 GetEffectiveWeight 方法支持动态权重
- 权重从 1 线性增加到配置权重,防止恢复服务器被压垮

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-22 13:15:09 +08:00