From da46e23ae04a35f51f55f927c28cb48c10401629 Mon Sep 17 00:00:00 2001 From: 0ceanSlim Date: Thu, 5 Sep 2024 11:06:21 -0400 Subject: [PATCH] refactor size limit function --- config/{sizeLimiter.go => setSizeLimit.go} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename config/{sizeLimiter.go => setSizeLimit.go} (95%) diff --git a/config/sizeLimiter.go b/config/setSizeLimit.go similarity index 95% rename from config/sizeLimiter.go rename to config/setSizeLimit.go index 48b9b62..651f302 100644 --- a/config/sizeLimiter.go +++ b/config/setSizeLimit.go @@ -18,7 +18,7 @@ func SetupSizeLimiter(cfg *config.ServerConfig) { sizeLimiter.AddKindSizeLimit(kindSizeLimit.Kind, kindSizeLimit.MaxSize) } - SetSizeLimiter(sizeLimiter) + SetSizeLimit(sizeLimiter) } func NewSizeLimiter(globalMaxSize int) *SizeLimiter { @@ -35,7 +35,7 @@ func GetSizeLimiter() *SizeLimiter { return sizeLimiterInstance } -func SetSizeLimiter(sl *SizeLimiter) { +func SetSizeLimit(sl *SizeLimiter) { sizeOnce.Do(func() { sizeLimiterInstance = sl })