mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
enhance(sdk):volume info get frequency should not be enlarged by uid
Signed-off-by: leonrayang <chl696@sina.com>
This commit is contained in:
parent
2345293edc
commit
7e22960ef7
@ -141,7 +141,6 @@ func NewDataPartitionWrapper(client SimpleClientInfo, volName string, masters []
|
||||
}
|
||||
}
|
||||
go w.uploadFlowInfoByTick(client)
|
||||
go w.updateSimpleVolViewByTick(client)
|
||||
go w.update(client)
|
||||
return
|
||||
}
|
||||
@ -235,28 +234,8 @@ func (w *Wrapper) uploadFlowInfoByTick(clientInfo SimpleClientInfo) {
|
||||
}
|
||||
}
|
||||
|
||||
// uid need get uids info by volView with high frequency, but if no uid works
|
||||
// use 1 minute is fine
|
||||
func (w *Wrapper) updateSimpleVolViewByTick(clientInfo SimpleClientInfo) {
|
||||
ticker := time.NewTicker(10 * time.Second)
|
||||
var tickCnt uint16
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
if len(w.Uids) == 0 && tickCnt%6 != 0 {
|
||||
tickCnt++
|
||||
continue
|
||||
}
|
||||
w.updateSimpleVolView(clientInfo)
|
||||
tickCnt++
|
||||
case <-w.stopC:
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (w *Wrapper) update(client SimpleClientInfo) {
|
||||
ticker := time.NewTicker(5 * time.Second)
|
||||
ticker := time.NewTicker(time.Minute)
|
||||
for {
|
||||
select {
|
||||
case <-ticker.C:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user