fix
This commit is contained in:
parent
0015ef7540
commit
0eaa357de5
|
@ -75,12 +75,17 @@ func (w *wsConnectItem) consumeRenderImageData() {
|
|||
logx.Error("func renderImage err:", err)
|
||||
}
|
||||
}()
|
||||
tick := time.Tick(w.extendRenderProperty.renderConsumeTickTime)
|
||||
var duration time.Duration = 1
|
||||
if w.extendRenderProperty.renderConsumeTickTime > 0 {
|
||||
duration = w.extendRenderProperty.renderConsumeTickTime
|
||||
}
|
||||
ticker := time.NewTicker(duration)
|
||||
defer ticker.Stop()
|
||||
for {
|
||||
select {
|
||||
case <-w.closeChan: //已关闭
|
||||
return
|
||||
case <-tick: //消费数据
|
||||
case <-ticker.C: //消费数据
|
||||
w.renderImage(<-w.extendRenderProperty.renderChan)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user