Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade go-redis to v7 #19

Merged
merged 1 commit into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions broker_redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/thoas/bokchoy/logging"

"github.com/go-redis/redis"
"github.com/go-redis/redis/v7"
"github.com/pkg/errors"
)

Expand Down Expand Up @@ -254,7 +254,7 @@ func (p *RedisBroker) consume(ctx context.Context, name string, taskPrefix strin
}
} else {
max := fmt.Sprintf("%d", eta.UTC().Unix())
results := p.Client.ZRangeByScore(queueKey, redis.ZRangeBy{
results := p.Client.ZRangeByScore(queueKey, &redis.ZRangeBy{
Min: "0",
Max: max,
})
Expand Down Expand Up @@ -465,7 +465,7 @@ func (p *RedisBroker) publish(client redis.Cmdable, queueName string,
if eta.Before(time.Now().UTC()) {
err = client.LPush(p.prefixed(queueName), taskID).Err()
} else {
err = client.ZAdd(p.prefixed(fmt.Sprint(queueName, ":delay")), redis.Z{
err = client.ZAdd(p.prefixed(fmt.Sprint(queueName, ":delay")), &redis.Z{
Score: float64(eta.UTC().Unix()),
Member: taskID,
}).Err()
Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package bokchoy

import "github.com/go-redis/redis"
import "github.com/go-redis/redis/v7"

// RedisClusterConfig contains the redis cluster configuration.
type RedisClusterConfig redis.ClusterOptions
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-broker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"log"
"time"

"github.com/go-redis/redis"
"github.com/go-redis/redis/v7"

"github.com/thoas/bokchoy"
"github.com/thoas/bokchoy/logging"
Expand Down
10 changes: 9 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ module github.com/thoas/bokchoy
go 1.13

require (
github.com/go-redis/redis v6.15.6+incompatible
github.com/PuerkitoBio/goquery v1.5.1
github.com/davecgh/go-spew v1.1.1
github.com/getsentry/sentry-go v0.6.0
github.com/go-redis/redis/v7 v7.2.0
github.com/gogo/protobuf v1.3.1
github.com/golang/protobuf v1.4.0
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0
github.com/mitchellh/mapstructure v1.2.2
github.com/oklog/ulid v1.3.1
github.com/pkg/errors v0.8.1
github.com/stretchr/testify v1.4.0
github.com/thoas/go-funk v0.4.0
go.uber.org/zap v1.12.0
google.golang.org/grpc v1.29.0
)
Loading