Skip to content

Commit 0ac96ea

Browse files
chore: don't overwrite builtin max function (#2321)
1 parent bf75246 commit 0ac96ea

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

cmd/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ func WithFuseTempDir(dir string) Option {
5252

5353
// WithMaxConnections sets the maximum allowed number of connections. Default
5454
// is no limit.
55-
func WithMaxConnections(max uint64) Option {
55+
func WithMaxConnections(mc uint64) Option {
5656
return func(c *Command) {
57-
c.conf.MaxConnections = max
57+
c.conf.MaxConnections = mc
5858
}
5959
}
6060

internal/healthcheck/healthcheck.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ func (c *Check) HandleReadiness(w http.ResponseWriter, _ *http.Request) {
9797
default:
9898
}
9999

100-
if open, max := c.proxy.ConnCount(); max > 0 && open == max {
101-
err := fmt.Errorf("max connections reached (open = %v, max = %v)", open, max)
100+
if open, maxCount := c.proxy.ConnCount(); maxCount > 0 && open == maxCount {
101+
err := fmt.Errorf("max connections reached (open = %v, max = %v)", open, maxCount)
102102
c.logger.Errorf("[Health Check] Readiness failed: %v", err)
103103
w.WriteHeader(http.StatusServiceUnavailable)
104104
w.Write([]byte(err.Error()))

0 commit comments

Comments
 (0)