refactor size limit function

This commit is contained in:
0ceanSlim 2024-09-05 11:06:21 -04:00
parent 0ab753bb2c
commit da46e23ae0

View File

@ -18,7 +18,7 @@ func SetupSizeLimiter(cfg *config.ServerConfig) {
sizeLimiter.AddKindSizeLimit(kindSizeLimit.Kind, kindSizeLimit.MaxSize) sizeLimiter.AddKindSizeLimit(kindSizeLimit.Kind, kindSizeLimit.MaxSize)
} }
SetSizeLimiter(sizeLimiter) SetSizeLimit(sizeLimiter)
} }
func NewSizeLimiter(globalMaxSize int) *SizeLimiter { func NewSizeLimiter(globalMaxSize int) *SizeLimiter {
@ -35,7 +35,7 @@ func GetSizeLimiter() *SizeLimiter {
return sizeLimiterInstance return sizeLimiterInstance
} }
func SetSizeLimiter(sl *SizeLimiter) { func SetSizeLimit(sl *SizeLimiter) {
sizeOnce.Do(func() { sizeOnce.Do(func() {
sizeLimiterInstance = sl sizeLimiterInstance = sl
}) })