aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-04-16 00:27:33 -0700
committerChris Lu <chris.lu@gmail.com>2018-04-16 00:27:35 -0700
commit8c64d06b3a960643bb9c874792c63091ef83908e (patch)
tree640ec12e6fa677c34d95060fa2ea69ee752ea895
parentda0d090af9d78bf0d9b7dbe67c27c7bc0e02d94d (diff)
downloadseaweedfs-8c64d06b3a960643bb9c874792c63091ef83908e.tar.xz
seaweedfs-8c64d06b3a960643bb9c874792c63091ef83908e.zip
update redis library
-rw-r--r--weed/filer/redis_store/redis_store.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/filer/redis_store/redis_store.go b/weed/filer/redis_store/redis_store.go
index 2ad49a805..5b8362983 100644
--- a/weed/filer/redis_store/redis_store.go
+++ b/weed/filer/redis_store/redis_store.go
@@ -3,7 +3,7 @@ package redis_store
import (
"github.com/chrislusf/seaweedfs/weed/filer"
- redis "gopkg.in/redis.v2"
+ "github.com/go-redis/redis"
)
type RedisStore struct {
@@ -11,10 +11,10 @@ type RedisStore struct {
}
func NewRedisStore(hostPort string, password string, database int) *RedisStore {
- client := redis.NewTCPClient(&redis.Options{
+ client := redis.NewClient(&redis.Options{
Addr: hostPort,
Password: password,
- DB: int64(database),
+ DB: database,
})
return &RedisStore{Client: client}
}
@@ -27,7 +27,7 @@ func (s *RedisStore) Get(fullFileName string) (fid string, err error) {
return fid, err
}
func (s *RedisStore) Put(fullFileName string, fid string) (err error) {
- _, err = s.Client.Set(fullFileName, fid).Result()
+ _, err = s.Client.Set(fullFileName, fid, 0).Result()
if err == redis.Nil {
err = nil
}