Skip to content

Commit

Permalink
chore(deps): upgrade go-redis to v9 (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxiaohei committed Aug 8, 2023
1 parent 98808b7 commit df1cbc8
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 67 deletions.
20 changes: 10 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/Shopify/sarama v1.19.0
github.com/Shopify/toxiproxy v2.1.4+incompatible // indirect
github.com/alicebob/miniredis/v2 v2.15.1
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cenkalti/backoff/v4 v4.1.3
github.com/dgraph-io/ristretto v0.0.3
github.com/eapache/go-resiliency v1.1.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
Expand All @@ -30,7 +30,6 @@ require (
github.com/go-playground/locales v0.14.1
github.com/go-playground/universal-translator v0.18.1
github.com/go-playground/validator/v10 v10.11.2
github.com/go-redis/redis/extra/redisotel/v8 v8.10.0
github.com/go-redis/redis/v8 v8.11.2
github.com/go-sql-driver/mysql v1.5.0
github.com/go-test/deep v1.0.6
Expand Down Expand Up @@ -58,16 +57,17 @@ require (
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.11.0
github.com/qiniu/api.v7 v0.0.0-20190520053455-bea02cd22bf4
github.com/rabbitmq/amqp091-go v1.8.1 // indirect
github.com/rabbitmq/amqp091-go v1.8.1
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/redis/go-redis/extra/redisotel/v9 v9.0.5
github.com/redis/go-redis/v9 v9.0.5
github.com/robfig/cron/v3 v3.0.1
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/spf13/afero v1.8.0 // indirect
github.com/spf13/cast v1.4.1
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.10.0
github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.8.3
github.com/swaggo/gin-swagger v1.2.0
github.com/swaggo/swag v1.7.0 // indirect
github.com/teris-io/shortid v0.0.0-20171029131806-771a37caa5cf
Expand All @@ -81,13 +81,13 @@ require (
go.mongodb.org/mongo-driver v1.5.1
go.opentelemetry.io/contrib v0.22.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.22.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.22.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.42.0
go.opentelemetry.io/contrib/propagators v0.22.0
go.opentelemetry.io/otel v1.3.0
go.opentelemetry.io/otel v1.16.0
go.opentelemetry.io/otel/exporters/jaeger v1.0.0-RC3
go.opentelemetry.io/otel/oteltest v1.0.0-RC3
go.opentelemetry.io/otel/sdk v1.0.0-RC3
go.opentelemetry.io/otel/trace v1.3.0
go.opentelemetry.io/otel/sdk v1.16.0
go.opentelemetry.io/otel/trace v1.16.0
go.uber.org/automaxprocs v1.5.1
go.uber.org/zap v1.17.0
golang.org/x/crypto v0.5.0
Expand Down
84 changes: 36 additions & 48 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/cache/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"reflect"
"time"

"github.com/go-redis/redis/v8"
"github.com/pkg/errors"
"github.com/redis/go-redis/v9"

"github.com/go-eagle/eagle/pkg/encoding"
"github.com/go-eagle/eagle/pkg/log"
Expand Down
2 changes: 1 addition & 1 deletion pkg/lock/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/go-eagle/eagle/pkg/log"

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

// RedisLock is a redis lock.
Expand Down
2 changes: 1 addition & 1 deletion pkg/redis/check_repeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strings"
"time"

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

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/redis/idalloc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strconv"
"strings"

"github.com/go-redis/redis/v8"
"github.com/pkg/errors"
"github.com/redis/go-redis/v9"

"github.com/go-eagle/eagle/pkg/log"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/redis/idalloc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

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

func TestNew(t *testing.T) {
Expand Down
10 changes: 6 additions & 4 deletions pkg/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"sync"

"github.com/alicebob/miniredis/v2"
"github.com/go-redis/redis/extra/redisotel/v8"
"github.com/go-redis/redis/v8"
"github.com/redis/go-redis/extra/redisotel/v9"
"github.com/redis/go-redis/v9"

"github.com/go-eagle/eagle/pkg/config"
)
Expand All @@ -23,7 +23,7 @@ const (
)

// RedisManager define a redis manager
//nolint
// nolint
type RedisManager struct {
clients map[string]*redis.Client
*sync.RWMutex
Expand Down Expand Up @@ -90,7 +90,9 @@ func (r *RedisManager) GetClient(name string) (*redis.Client, error) {

// hook tracing (using open telemetry)
if c.EnableTrace {
rdb.AddHook(redisotel.NewTracingHook())
if err := redisotel.InstrumentTracing(rdb); err != nil {
return nil, err
}
}
r.clients[name] = rdb

Expand Down

0 comments on commit df1cbc8

Please sign in to comment.