diff --git a/cmd/options.go b/cmd/options.go index e0007cdf4..aceb01843 100644 --- a/cmd/options.go +++ b/cmd/options.go @@ -52,9 +52,9 @@ func WithFuseTempDir(dir string) Option { // WithMaxConnections sets the maximum allowed number of connections. Default // is no limit. -func WithMaxConnections(max uint64) Option { +func WithMaxConnections(mc uint64) Option { return func(c *Command) { - c.conf.MaxConnections = max + c.conf.MaxConnections = mc } } diff --git a/internal/healthcheck/healthcheck.go b/internal/healthcheck/healthcheck.go index f0dedd6d7..3c95d5409 100644 --- a/internal/healthcheck/healthcheck.go +++ b/internal/healthcheck/healthcheck.go @@ -97,8 +97,8 @@ func (c *Check) HandleReadiness(w http.ResponseWriter, _ *http.Request) { default: } - if open, max := c.proxy.ConnCount(); max > 0 && open == max { - err := fmt.Errorf("max connections reached (open = %v, max = %v)", open, max) + if open, maxCount := c.proxy.ConnCount(); maxCount > 0 && open == maxCount { + err := fmt.Errorf("max connections reached (open = %v, max = %v)", open, maxCount) c.logger.Errorf("[Health Check] Readiness failed: %v", err) w.WriteHeader(http.StatusServiceUnavailable) w.Write([]byte(err.Error()))