1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +03:00
This commit is contained in:
Vladimir Mihailenco
2020-06-10 15:04:12 +03:00
parent ef82e3705c
commit 736fa28659
6 changed files with 89 additions and 90 deletions

16
ring.go
View File

@ -685,14 +685,6 @@ func (c *Ring) processShardPipeline(
return err
}
// Close closes the ring client, releasing any open resources.
//
// It is rare to Close a Ring, as the Ring is meant to be long-lived
// and shared between many goroutines.
func (c *Ring) Close() error {
return c.shards.Close()
}
func (c *Ring) Watch(ctx context.Context, fn func(*Tx) error, keys ...string) error {
if len(keys) == 0 {
return fmt.Errorf("redis: Watch requires at least one key")
@ -725,3 +717,11 @@ func (c *Ring) Watch(ctx context.Context, fn func(*Tx) error, keys ...string) er
return shards[0].Client.Watch(ctx, fn, keys...)
}
// Close closes the ring client, releasing any open resources.
//
// It is rare to Close a Ring, as the Ring is meant to be long-lived
// and shared between many goroutines.
func (c *Ring) Close() error {
return c.shards.Close()
}