aboutsummaryrefslogtreecommitdiffstats
path: root/src/dma/vendor/github.com/go-redis/redis/cluster_commands.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/dma/vendor/github.com/go-redis/redis/cluster_commands.go')
-rw-r--r--src/dma/vendor/github.com/go-redis/redis/cluster_commands.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/dma/vendor/github.com/go-redis/redis/cluster_commands.go b/src/dma/vendor/github.com/go-redis/redis/cluster_commands.go
new file mode 100644
index 00000000..dff62c90
--- /dev/null
+++ b/src/dma/vendor/github.com/go-redis/redis/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
+}