Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
buraksezer committed Oct 26, 2023
1 parent 7cd0940 commit 131d7fd
Show file tree
Hide file tree
Showing 22 changed files with 102 additions and 161 deletions.
2 changes: 1 addition & 1 deletion cluster_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
"github.com/buraksezer/olric/internal/server"
"github.com/buraksezer/olric/pkg/storage"
"github.com/buraksezer/olric/stats"
"github.com/go-redis/redis/v8"
"github.com/redis/go-redis/v9"
)

var pool = bufpool.New()
Expand Down
48 changes: 20 additions & 28 deletions config/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"runtime"
"time"

"github.com/go-redis/redis/v8"
"github.com/redis/go-redis/v9"
)

const (
Expand Down Expand Up @@ -97,12 +97,6 @@ type Client struct {
// Default is 5 minutes. -1 disables idle timeout check.
IdleTimeout time.Duration

// Frequency of idle checks made by idle connections reaper.
// Default is 1 minute. -1 disables idle connections reaper,
// but idle connections are still discarded by the client
// if IdleTimeout is set.
IdleCheckFrequency time.Duration

// TLS Config to use. When set TLS will be negotiated.
TLSConfig *tls.Config

Expand Down Expand Up @@ -158,9 +152,6 @@ func (c *Client) Sanitize() error {
if c.IdleTimeout == 0 {
c.IdleTimeout = DefaultIdleTimeout
}
if c.IdleCheckFrequency == 0 {
c.IdleCheckFrequency = time.Minute
}

if c.MaxRetries == -1 {
c.MaxRetries = 0
Expand All @@ -187,25 +178,26 @@ func (c *Client) Sanitize() error {
func (c *Client) Validate() error { return nil }

func (c *Client) RedisOptions() *redis.Options {
// Note: IdleCheckFrequency is gone since go-redis no longer checks idle connections.
// See https://github.com/redis/go-redis/discussions/2635
return &redis.Options{
Network: "tcp",
Dialer: c.Dialer,
OnConnect: c.OnConnect,
MaxRetries: c.MaxRetries,
MinRetryBackoff: c.MinRetryBackoff,
MaxRetryBackoff: c.MaxRetryBackoff,
DialTimeout: c.DialTimeout,
ReadTimeout: c.ReadTimeout,
WriteTimeout: c.WriteTimeout,
PoolFIFO: c.PoolFIFO,
PoolSize: c.PoolSize,
MinIdleConns: c.MinIdleConns,
MaxConnAge: c.MaxConnAge,
PoolTimeout: c.PoolTimeout,
IdleTimeout: c.IdleTimeout,
IdleCheckFrequency: c.IdleCheckFrequency,
TLSConfig: c.TLSConfig,
Limiter: c.Limiter,
Network: "tcp",
Dialer: c.Dialer,
OnConnect: c.OnConnect,
MaxRetries: c.MaxRetries,
MinRetryBackoff: c.MinRetryBackoff,
MaxRetryBackoff: c.MaxRetryBackoff,
DialTimeout: c.DialTimeout,
ReadTimeout: c.ReadTimeout,
WriteTimeout: c.WriteTimeout,
PoolFIFO: c.PoolFIFO,
PoolSize: c.PoolSize,
MinIdleConns: c.MinIdleConns,
ConnMaxLifetime: c.MaxConnAge,
PoolTimeout: c.PoolTimeout,
ConnMaxIdleTime: c.IdleTimeout,
TLSConfig: c.TLSConfig,
Limiter: c.Limiter,
}
}

Expand Down
2 changes: 0 additions & 2 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ client:
maxConnAge: 2h
poolTimeout: 4s
idleTimeout: 6m
idleCheckFrequency: 8m
logging:
verbosity: 6
Expand Down Expand Up @@ -167,7 +166,6 @@ func TestConfig(t *testing.T) {
c.Client.MaxConnAge = 2 * time.Hour
c.Client.PoolTimeout = 4 * time.Second
c.Client.IdleTimeout = 6 * time.Minute
c.Client.IdleCheckFrequency = 8 * time.Minute

c.LogVerbosity = 6
c.LogLevel = "DEBUG"
Expand Down
25 changes: 12 additions & 13 deletions config/internal/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,18 @@ type olricd struct {
}

type client struct {
DialTimeout string `yaml:"dialTimeout"`
ReadTimeout string `yaml:"readTimeout"`
WriteTimeout string `yaml:"writeTimeout"`
MaxRetries int `yaml:"maxRetries"`
MinRetryBackoff string `yaml:"minRetryBackoff"`
MaxRetryBackoff string `yaml:"maxRetryBackoff"`
PoolFIFO bool `yaml:"poolFIFO"`
PoolSize int `yaml:"poolSize"`
MinIdleConns int `yaml:"minIdleConns"`
MaxConnAge string `yaml:"maxConnAge"`
PoolTimeout string `yaml:"poolTimeout"`
IdleTimeout string `yaml:"idleTimeout"`
IdleCheckFrequency string `yaml:"idleCheckFrequency"`
DialTimeout string `yaml:"dialTimeout"`
ReadTimeout string `yaml:"readTimeout"`
WriteTimeout string `yaml:"writeTimeout"`
MaxRetries int `yaml:"maxRetries"`
MinRetryBackoff string `yaml:"minRetryBackoff"`
MaxRetryBackoff string `yaml:"maxRetryBackoff"`
PoolFIFO bool `yaml:"poolFIFO"`
PoolSize int `yaml:"poolSize"`
MinIdleConns int `yaml:"minIdleConns"`
MaxConnAge string `yaml:"maxConnAge"`
PoolTimeout string `yaml:"poolTimeout"`
IdleTimeout string `yaml:"idleTimeout"`
}

// logging contains configuration variables of logging section of config file.
Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ module github.com/buraksezer/olric
go 1.13

require (
github.com/RoaringBitmap/roaring v1.2.1
github.com/RoaringBitmap/roaring v1.6.0
github.com/buraksezer/consistent v0.10.0
github.com/cespare/xxhash/v2 v2.1.2
github.com/go-redis/redis/v8 v8.11.5
github.com/cespare/xxhash/v2 v2.2.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-sockaddr v1.0.2
github.com/hashicorp/go-sockaddr v1.0.5
github.com/hashicorp/logutils v1.0.0
github.com/hashicorp/memberlist v0.5.0
github.com/miekg/dns v1.1.45 // indirect
github.com/pkg/errors v0.9.1
github.com/redis/go-redis/v9 v9.2.1
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529
github.com/stretchr/testify v1.7.0
github.com/tidwall/btree v1.1.0
github.com/stretchr/testify v1.8.4
github.com/tidwall/btree v1.7.0
github.com/tidwall/match v1.1.1
github.com/tidwall/redcon v1.6.2
github.com/vmihailenco/msgpack/v5 v5.3.5
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
github.com/vmihailenco/msgpack/v5 v5.4.1
golang.org/x/sync v0.4.0
gopkg.in/yaml.v2 v2.4.0
)
Loading

0 comments on commit 131d7fd

Please sign in to comment.