mirror of https://github.com/go-redis/redis.git
gofmt
This commit is contained in:
parent
c86c158b1f
commit
80673992e6
|
@ -650,7 +650,7 @@ func (c *ClusterClient) reaper(idleCheckFrequency time.Duration) {
|
||||||
ticker := time.NewTicker(idleCheckFrequency)
|
ticker := time.NewTicker(idleCheckFrequency)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
|
|
||||||
for _ = range ticker.C {
|
for range ticker.C {
|
||||||
nodes, err := c.nodes.All()
|
nodes, err := c.nodes.All()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break
|
break
|
||||||
|
|
|
@ -29,7 +29,7 @@ func wrapRedisProcess(client *redis.Client) {
|
||||||
var count, avgDur uint32
|
var count, avgDur uint32
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
for _ = range time.Tick(3 * time.Second) {
|
for range time.Tick(3 * time.Second) {
|
||||||
n := atomic.LoadUint32(&count)
|
n := atomic.LoadUint32(&count)
|
||||||
dur := time.Duration(atomic.LoadUint32(&avgDur)) * precision
|
dur := time.Duration(atomic.LoadUint32(&avgDur)) * precision
|
||||||
fmt.Printf("%s: processed=%d avg_dur=%s\n", client, n, dur)
|
fmt.Printf("%s: processed=%d avg_dur=%s\n", client, n, dur)
|
||||||
|
|
|
@ -319,7 +319,7 @@ func (p *ConnPool) reaper(frequency time.Duration) {
|
||||||
ticker := time.NewTicker(frequency)
|
ticker := time.NewTicker(frequency)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
|
|
||||||
for _ = range ticker.C {
|
for range ticker.C {
|
||||||
if p.closed() {
|
if p.closed() {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
2
ring.go
2
ring.go
|
@ -302,7 +302,7 @@ func (c *Ring) rebalance() {
|
||||||
func (c *Ring) heartbeat() {
|
func (c *Ring) heartbeat() {
|
||||||
ticker := time.NewTicker(c.opt.HeartbeatFrequency)
|
ticker := time.NewTicker(c.opt.HeartbeatFrequency)
|
||||||
defer ticker.Stop()
|
defer ticker.Stop()
|
||||||
for _ = range ticker.C {
|
for range ticker.C {
|
||||||
var rebalance bool
|
var rebalance bool
|
||||||
|
|
||||||
c.mu.RLock()
|
c.mu.RLock()
|
||||||
|
|
Loading…
Reference in New Issue