1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +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

@ -8,6 +8,7 @@ import (
"time"
"gopkg.in/redis.v3/internal/consistenthash"
"gopkg.in/redis.v3/internal/hashtag"
)
var (
@ -151,7 +152,7 @@ func (ring *Ring) getClient(key string) (*Client, error) {
return nil, errClosed
}
name := ring.hash.Get(hashKey(key))
name := ring.hash.Get(hashtag.Key(key))
if name == "" {
ring.mx.RUnlock()
return nil, errRingShardsDown
@ -297,7 +298,7 @@ func (pipe *RingPipeline) Exec() (cmds []Cmder, retErr error) {
cmdsMap := make(map[string][]Cmder)
for _, cmd := range cmds {
name := pipe.ring.hash.Get(hashKey(cmd.clusterKey()))
name := pipe.ring.hash.Get(hashtag.Key(cmd.clusterKey()))
if name == "" {
cmd.setErr(errRingShardsDown)
if retErr == nil {