Skip to content

Commit

Permalink
chore: don't overwrite builtin max function
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwotherspoon committed Nov 20, 2024
1 parent bf75246 commit 5047863
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
4 changes: 2 additions & 2 deletions internal/healthcheck/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down

0 comments on commit 5047863

Please sign in to comment.