mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
chore(err): Extract crossslot err and add test
This commit is contained in:
@ -1506,9 +1506,8 @@ func (c *ClusterClient) processTxPipeline(ctx context.Context, cmds []Cmder) err
|
||||
cmdsMap := c.mapCmdsBySlot(cmds)
|
||||
// TxPipeline does not support cross slot transaction.
|
||||
if len(cmdsMap) > 1 {
|
||||
err := fmt.Errorf("redis: CROSSSLOT Keys in request don't hash to the same slot")
|
||||
setCmdsErr(cmds, err)
|
||||
return err
|
||||
setCmdsErr(cmds, ErrCrossSlot)
|
||||
return ErrCrossSlot
|
||||
}
|
||||
if len(cmdsMap) == 0 {
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user