diff options
Diffstat (limited to 'vendor/github.com/go-redis/redis/v7/cluster_commands.go')
-rw-r--r-- | vendor/github.com/go-redis/redis/v7/cluster_commands.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/github.com/go-redis/redis/v7/cluster_commands.go b/vendor/github.com/go-redis/redis/v7/cluster_commands.go new file mode 100644 index 0000000000..c9b9b9de24 --- /dev/null +++ b/vendor/github.com/go-redis/redis/v7/cluster_commands.go @@ -0,0 +1,22 @@ +package redis + +import "sync/atomic" + +func (c *ClusterClient) DBSize() *IntCmd { + cmd := NewIntCmd("dbsize") + var size int64 + err := c.ForEachMaster(func(master *Client) error { + n, err := master.DBSize().Result() + if err != nil { + return err + } + atomic.AddInt64(&size, n) + return nil + }) + if err != nil { + cmd.SetErr(err) + return cmd + } + cmd.val = size + return cmd +} |