1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Create hashtag package.

This commit is contained in:
Anatolii Mihailenco
2015-12-30 15:53:45 +02:00
parent cbc5360e78
commit 0bf3759a6d
7 changed files with 49 additions and 43 deletions

View File

@ -1,5 +1,9 @@
package redis
import (
"gopkg.in/redis.v3/internal/hashtag"
)
// ClusterPipeline is not thread-safe.
type ClusterPipeline struct {
commandable
@ -48,7 +52,7 @@ func (pipe *ClusterPipeline) Exec() (cmds []Cmder, retErr error) {
cmdsMap := make(map[string][]Cmder)
for _, cmd := range cmds {
slot := hashSlot(cmd.clusterKey())
slot := hashtag.Slot(cmd.clusterKey())
addr := pipe.cluster.slotMasterAddr(slot)
cmdsMap[addr] = append(cmdsMap[addr], cmd)
}