mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
ring: return an error in pipeline when all shards are down.
This commit is contained in:
@ -94,6 +94,15 @@ var _ = Describe("Redis ring", func() {
|
||||
})
|
||||
|
||||
Describe("pipelining", func() {
|
||||
It("returns an error when all shards are down", func() {
|
||||
ring := redis.NewRing(&redis.RingOptions{})
|
||||
_, err := ring.Pipelined(func(pipe *redis.RingPipeline) error {
|
||||
pipe.Ping()
|
||||
return nil
|
||||
})
|
||||
Expect(err).To(MatchError("redis: all ring shards are down"))
|
||||
})
|
||||
|
||||
It("uses both shards", func() {
|
||||
pipe := ring.Pipeline()
|
||||
for i := 0; i < 100; i++ {
|
||||
|
Reference in New Issue
Block a user