Skip to content

Commit

Permalink
refactor(cache): support redis user/pass
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Mar 10, 2021
1 parent 04e7272 commit e19b3bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cache/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ func connect() redis.Conn {
return nil
}

c, err := redis.Dial("tcp", cacheHost)
user, pass := os.Getenv("APP_CACHE_USER"), os.Getenv("APP_CACHE_PASS")
c, err := redis.Dial("tcp", cacheHost, redis.DialUsername(user), redis.DialPassword(pass))
if err != nil {
log.Printf("%v", err)
return nil
Expand Down

0 comments on commit e19b3bc

Please sign in to comment.