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

fix redis #59

Merged
merged 4 commits into from Feb 20, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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