diff options
author | Igor Wiedler <iwiedler@gitlab.com> | 2021-03-08 11:46:05 +0300 |
---|---|---|
committer | Igor Wiedler <iwiedler@gitlab.com> | 2021-03-08 11:46:05 +0300 |
commit | 6b6476edc20551c801fbb2101f1a8f26177fcf39 (patch) | |
tree | 022958f657ad7f5edad058157b3d5fd74ec1b78d /app.go | |
parent | 48866aab333072a24217be89700a1c6d7b180d8d (diff) |
Set max-conns to 0 by default, making concurrency limit opt-inmax-conns-default-zero
Diffstat (limited to 'app.go')
-rw-r--r-- | app.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -359,7 +359,10 @@ func (a *theApp) buildHandlerPipeline() (http.Handler, error) { func (a *theApp) Run() { var wg sync.WaitGroup - limiter := netutil.NewLimiter(a.config.General.MaxConns) + var limiter *netutil.Limiter + if a.config.General.MaxConns > 0 { + limiter = netutil.NewLimiter(a.config.General.MaxConns) + } // Use a common pipeline to use a single instance of each handler, // instead of making two nearly identical pipelines |