mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
use time.NewTicker instead of time.Tick. (#4119)
This commit is contained in:
parent
51d4a4b28d
commit
83e29faa55
|
@ -158,8 +158,8 @@ func (vs *VolumeServer) doHeartbeat(masterAddress pb.ServerAddress, grpcDialOpti
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
volumeTickChan := time.Tick(sleepInterval)
|
volumeTickChan := time.NewTicker(sleepInterval)
|
||||||
ecShardTickChan := time.Tick(17 * sleepInterval)
|
ecShardTickChan := time.NewTicker(17 * sleepInterval)
|
||||||
dataCenter := vs.store.GetDataCenter()
|
dataCenter := vs.store.GetDataCenter()
|
||||||
rack := vs.store.GetRack()
|
rack := vs.store.GetRack()
|
||||||
ip := vs.store.Ip
|
ip := vs.store.Ip
|
||||||
|
@ -228,14 +228,14 @@ func (vs *VolumeServer) doHeartbeat(masterAddress pb.ServerAddress, grpcDialOpti
|
||||||
glog.V(0).Infof("Volume Server Failed to update to master %s: %v", masterAddress, err)
|
glog.V(0).Infof("Volume Server Failed to update to master %s: %v", masterAddress, err)
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
case <-volumeTickChan:
|
case <-volumeTickChan.C:
|
||||||
glog.V(4).Infof("volume server %s:%d heartbeat", vs.store.Ip, vs.store.Port)
|
glog.V(4).Infof("volume server %s:%d heartbeat", vs.store.Ip, vs.store.Port)
|
||||||
vs.store.MaybeAdjustVolumeMax()
|
vs.store.MaybeAdjustVolumeMax()
|
||||||
if err = stream.Send(vs.store.CollectHeartbeat()); err != nil {
|
if err = stream.Send(vs.store.CollectHeartbeat()); err != nil {
|
||||||
glog.V(0).Infof("Volume Server Failed to talk with master %s: %v", masterAddress, err)
|
glog.V(0).Infof("Volume Server Failed to talk with master %s: %v", masterAddress, err)
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
case <-ecShardTickChan:
|
case <-ecShardTickChan.C:
|
||||||
glog.V(4).Infof("volume server %s:%d ec heartbeat", vs.store.Ip, vs.store.Port)
|
glog.V(4).Infof("volume server %s:%d ec heartbeat", vs.store.Ip, vs.store.Port)
|
||||||
if err = stream.Send(vs.store.CollectErasureCodingHeartbeat()); err != nil {
|
if err = stream.Send(vs.store.CollectErasureCodingHeartbeat()); err != nil {
|
||||||
glog.V(0).Infof("Volume Server Failed to talk with master %s: %v", masterAddress, err)
|
glog.V(0).Infof("Volume Server Failed to talk with master %s: %v", masterAddress, err)
|
||||||
|
|
Loading…
Reference in a new issue