Skip to content

Commit

Permalink
Fixed error return value for MGetWithGD
Browse files Browse the repository at this point in the history
  • Loading branch information
nvorobev committed Jun 16, 2022
1 parent 5279068 commit bfd7635
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v2.0.1 (2022-06-16)

- Fixed error return value for MGetWithGD

## v2.0.0 (2022-05-19)

- Update go-redis library to v8
Expand Down
9 changes: 8 additions & 1 deletion pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,14 @@ func (p *Pool) MGetWithGD(ctx context.Context, keys ...string) ([]interface{}, m
fn := func(factory *ShardConnFactory, keyList ...string) redis.Cmder {
conn, err := factory.getSlaveConn(keyList[0])
if err != nil {
return newErrorCmd(err)
args := make([]interface{}, 1+len(keyList))
args[0] = "mget"
for i, key := range keyList {
args[1+i] = key
}
cmd := redis.NewSliceCmd(ctx, args...)
cmd.SetErr(err)
return cmd
}
return conn.MGet(ctx, keyList...)
}
Expand Down

0 comments on commit bfd7635

Please sign in to comment.