feat(login): 增加登录接口速率限制配置 提升限流器的速率限制参数,从每秒10个请求、5个令牌增加到每秒150个请求、50个令牌, 以支持更高的并发访问需求。 ```
This commit is contained in:
@@ -62,7 +62,7 @@ func beforeServeHook(r *ghttp.Request) {
|
|||||||
r.Response.CORSDefault()
|
r.Response.CORSDefault()
|
||||||
}
|
}
|
||||||
|
|
||||||
var limiter = rate.NewLimiter(rate.Limit(10), 5)
|
var limiter = rate.NewLimiter(rate.Limit(150), 50)
|
||||||
|
|
||||||
// Limiter is a middleware that implements rate limiting for all HTTP requests.
|
// Limiter is a middleware that implements rate limiting for all HTTP requests.
|
||||||
// It returns HTTP 429 (Too Many Requests) when the rate limit is exceeded.
|
// It returns HTTP 429 (Too Many Requests) when the rate limit is exceeded.
|
||||||
|
|||||||
Reference in New Issue
Block a user