feat: add environment variable switch for critical rate limit

This commit is contained in:
Leon
2025-11-06 15:23:34 +08:00
parent 424325162e
commit 50e8639a40
3 changed files with 11 additions and 4 deletions

View File

@@ -102,7 +102,10 @@ func GlobalAPIRateLimit() func(c *gin.Context) {
}
func CriticalRateLimit() func(c *gin.Context) {
return rateLimitFactory(common.CriticalRateLimitNum, common.CriticalRateLimitDuration, "CT")
if common.CriticalRateLimitEnable {
return rateLimitFactory(common.CriticalRateLimitNum, common.CriticalRateLimitDuration, "CT")
}
return defNext
}
func DownloadRateLimit() func(c *gin.Context) {