Skip to content

Commit

Permalink
Merge pull request #65 from Icinga/drop-utils-maxint
Browse files Browse the repository at this point in the history
utils: Drop MaxInt
  • Loading branch information
lippserd authored Sep 24, 2024
2 parents 20c0537 + 4bb0ac7 commit afba056
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion redis/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func NewClientFromConfig(c *Config, logger *logging.Logger) (*Client, error) {

client := redis.NewClient(options)
options = client.Options()
options.PoolSize = utils.MaxInt(32, options.PoolSize)
options.PoolSize = max(32, options.PoolSize)
options.MaxRetries = options.PoolSize + 1 // https://github.com/go-redis/redis/issues/1737

return NewClient(redis.NewClient(options), logger, &c.Options), nil
Expand Down
9 changes: 0 additions & 9 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,6 @@ func AppName() string {
return filepath.Base(exe)
}

// MaxInt returns the larger of the given integers.
func MaxInt(x, y int) int {
if x > y {
return x
}

return y
}

// IsUnixAddr indicates whether the given host string represents a Unix socket address.
//
// A host string that begins with a forward slash ('/') is considered Unix socket address.
Expand Down

0 comments on commit afba056

Please sign in to comment.