feat: add environment variable switch for critical rate limit

This commit is contained in:
Leon committed 2025-11-06 15:23:34 +08:00
1 parent 942a4311ab
commit 71c26a5843
3 files changed
+11 -4

No files matched your search

+4 -1
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) {