fix: new cache(redis) uri invalid
This commit is contained in:
2
database/cache/option.go
vendored
2
database/cache/option.go
vendored
@ -22,7 +22,7 @@ func WithCtx(ctx context.Context) OptionFn {
|
||||
|
||||
func WithRedis(host string, port int, username, password string) OptionFn {
|
||||
return func(c *config) {
|
||||
uri := fmt.Sprintf("%s:%d", host, port)
|
||||
uri := fmt.Sprintf("redis://%s:%d", host, port)
|
||||
if username != "" || password != "" {
|
||||
uri = fmt.Sprintf("redis://%s:%s@%s:%d", username, password, host, port)
|
||||
}
|
||||
|
Reference in New Issue
Block a user