add redis password

fix https://github.com/chrislusf/seaweedfs/issues/263
This commit is contained in:
chrislusf
2016-03-08 08:46:28 -08:00
parent f7f9129b05
commit 4c8367a8b3
4 changed files with 9 additions and 6 deletions

View File

@@ -8,10 +8,10 @@ type RedisStore struct {
Client *redis.Client
}
func NewRedisStore(hostPort string, database int) *RedisStore {
func NewRedisStore(hostPort string, password string, database int) *RedisStore {
client := redis.NewTCPClient(&redis.Options{
Addr: hostPort,
Password: "", // no password set
Password: password,
DB: int64(database),
})
return &RedisStore{Client: client}