This commit is contained in:
Poloskin Valentin Georgievich 2017-04-02 17:10:47 +03:00
parent c86c158b1f
commit 80673992e6
4 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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)

View File

@ -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
} }

View File

@ -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()