Skip to content

Commit

Permalink
Fixes non compatibility with redis<7.2 (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusfcr committed Feb 20, 2024
1 parent bb700d1 commit ea0cac9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -5,13 +5,13 @@ go:
env:
global:
- CGO_ENABLED=0
services:
- redis-server
gobuild_args: -a -tags netgo -ldflags '-w'
go_import_path: github.com/adevinta/vulcan-stream
before_script: docker run -p 6379:6379 -d --name redis redis:6-alpine
script:
- go test -v $(go list ./... | grep -v /vendor/)
- go install ./...
- _script/test
after_script: docker rm -f redis
after_success:
- bash -c 'source <(curl -s https://raw.githubusercontent.com/adevinta/vulcan-cicd/master/docker.sh)'
2 changes: 1 addition & 1 deletion cmd/vulcan-stream-test-client/main.go
Expand Up @@ -68,7 +68,7 @@ func wsClient(l *log.Logger, c config.Config, t string, resCh chan bool, conCh c
go func() {
var err error
for {
err = websocket.ReadJSON(conn, &message)
err = conn.ReadJSON(&message)
if err != nil {
fmt.Println("Error receiving message: ", err.Error())
break
Expand Down
11 changes: 6 additions & 5 deletions storage.go
Expand Up @@ -49,11 +49,12 @@ type RedisDB struct {
// NewRedisDB builds a new redis DB connector.
func NewRedisDB(c RedisConfig) *RedisDB {
rdb := redis.NewClient(&redis.Options{
Addr: fmt.Sprint(c.Host, ":", c.Port),
Username: c.Usr,
Password: c.Pwd,
DB: c.DB,
DialTimeout: time.Second * 10,
Addr: fmt.Sprint(c.Host, ":", c.Port),
Username: c.Usr,
Password: c.Pwd,
DB: c.DB,
DialTimeout: time.Second * 10,
DisableIndentity: true, // Fixes https://github.com/redis/go-redis/pull/2880
})

if c.TTL == 0 {
Expand Down

0 comments on commit ea0cac9

Please sign in to comment.