mirror of
https://github.com/go-gitea/gitea.git
synced 2024-11-26 12:09:43 +08:00
e7d7dcb090
* add redis queue * finished indexer redis queue * add redis vendor * fix vet * Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-Authored-By: lunny <xiaolunwen@gmail.com> * switch to go mod * Update required changes for new logging func signatures
23 lines
376 B
Go
Vendored
23 lines
376 B
Go
Vendored
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
|
|
}
|