enhance(sdk):volume info get frequency should not be enlarged by uid

Signed-off-by: leonrayang <chl696@sina.com>
This commit is contained in:
leonrayang 2023-09-07 11:28:30 +08:00 committed by Whale Tang
parent 2345293edc
commit 7e22960ef7

View File

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