mirror of
https://github.com/0ceanSlim/grain.git
synced 2024-11-22 00:27:14 +00:00
refactor size limit function
This commit is contained in:
parent
0ab753bb2c
commit
da46e23ae0
@ -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
|
||||||
})
|
})
|
Loading…
Reference in New Issue
Block a user