Commit 2b18babb authored by felipe andrade's avatar felipe andrade Committed by GitHub

feat(proxyd): make max batch size hard limit 1000 and default 100 (#7719)

            * feat: make max batch size hard limit 1000 and default 100

* nit: rename const
  
  
parent 58769ba1
...@@ -34,7 +34,8 @@ const ( ...@@ -34,7 +34,8 @@ const (
ContextKeyAuth = "authorization" ContextKeyAuth = "authorization"
ContextKeyReqID = "req_id" ContextKeyReqID = "req_id"
ContextKeyXForwardedFor = "x_forwarded_for" ContextKeyXForwardedFor = "x_forwarded_for"
MaxBatchRPCCallsHardLimit = 100 DefaultMaxBatchRPCCallsLimit = 100
MaxBatchRPCCallsHardLimit = 1000
cacheStatusHdr = "X-Proxyd-Cache-Status" cacheStatusHdr = "X-Proxyd-Cache-Status"
defaultRPCTimeout = 10 * time.Second defaultRPCTimeout = 10 * time.Second
defaultBodySizeLimit = 256 * opt.KiB defaultBodySizeLimit = 256 * opt.KiB
...@@ -108,7 +109,11 @@ func NewServer( ...@@ -108,7 +109,11 @@ func NewServer(
maxUpstreamBatchSize = defaultMaxUpstreamBatchSize maxUpstreamBatchSize = defaultMaxUpstreamBatchSize
} }
if maxBatchSize == 0 || maxBatchSize > MaxBatchRPCCallsHardLimit { if maxBatchSize == 0 {
maxBatchSize = DefaultMaxBatchRPCCallsLimit
}
if maxBatchSize > MaxBatchRPCCallsHardLimit {
maxBatchSize = MaxBatchRPCCallsHardLimit maxBatchSize = MaxBatchRPCCallsHardLimit
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment