Skip to content

Commit

Permalink
redis username
Browse files Browse the repository at this point in the history
  • Loading branch information
superisaac committed Jan 24, 2024
1 parent 5d2af97 commit 974c63d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/redisutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ func GetRedisOptions(redisUrl string) (*redis.Options, error) {
return nil, err
}
}

pwd, ok := u.User.Password()
if !ok {
pwd = ""
}

opt := &redis.Options{
Addr: u.Host,
Username: u.User.Username(),
Password: pwd,
DB: db,
}
Expand Down

0 comments on commit 974c63d

Please sign in to comment.