Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LyricTian committed Jun 3, 2018
1 parent 0e3517c commit 0eb5e71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func NewRedisStore(opts *Options) session.ManagerStore {
if opts == nil {
panic("options cannot be nil")
}
return &managerStore{cli: redis.NewClient(opts.redisOptions())}
return NewRedisStoreWithCli(redis.NewClient(opts.redisOptions()))
}

// NewRedisStoreWithCli create an instance of a redis store
Expand All @@ -42,7 +42,7 @@ func NewRedisClusterStore(opts *ClusterOptions) session.ManagerStore {
if opts == nil {
panic("options cannot be nil")
}
return &managerStore{cli: redis.NewClusterClient(opts.redisClusterOptions())}
return NewRedisClusterStoreWithCli(redis.NewClusterClient(opts.redisClusterOptions()))
}

// NewRedisClusterStoreWithCli create an instance of a redis cluster store
Expand Down
6 changes: 2 additions & 4 deletions redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ func TestStore(t *testing.T) {
defer mstore.Close()

Convey("Test redis storage operation", t, func() {
store, err := mstore.Create(context.Background(), "test_memory_store", 10)
if err != nil {
So(err, ShouldBeNil)
}
store, err := mstore.Create(context.Background(), "test_redis_store", 10)
So(err, ShouldBeNil)
foo, ok := store.Get("foo")
So(ok, ShouldBeFalse)
So(foo, ShouldBeNil)
Expand Down

0 comments on commit 0eb5e71

Please sign in to comment.