feat(loadtest): sync add real 500-session capacity harness

This commit is contained in:
iamxvbaba 2026-08-02 12:02:07 +08:00
parent ac0566f779
commit 141f2f20c4
39 changed files with 4157 additions and 42 deletions

View file

@ -67,6 +67,13 @@ func (r *Router) checkSendRateLimit(ctx context.Context, userID int64, cost int)
}
allowed, retryAfter, err := r.deps.Limiter.AllowN(ctx, sendRateLimitKeyPrefix+strconv.FormatInt(userID, 10), cost, limit, window)
if err != nil {
r.log.Warn("message send rate limiter failed",
append(r.contextLogFields(ctx),
zap.Error(err),
zap.Int("cost", cost),
zap.Int("limit", limit),
zap.Duration("window", window),
)...)
return internalErr()
}
if allowed {