fix: 修复 server 包连接断开消息分发器阻塞的问题,优化等待消息时打印的日志频率
This commit is contained in:
@@ -116,7 +116,7 @@ func (d *Dispatcher[P, M]) Expel() {
|
||||
func (d *Dispatcher[P, M]) noLockExpel() {
|
||||
d.expel = true
|
||||
if d.mc <= 0 {
|
||||
d.abort <- struct{}{}
|
||||
close(d.abort)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ func (d *Dispatcher[P, M]) IncrCount(producer P, i int64) {
|
||||
d.mc += i
|
||||
d.pmc[producer] += i
|
||||
if d.expel && d.mc <= 0 {
|
||||
d.abort <- struct{}{}
|
||||
close(d.abort)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,6 @@ func (d *Dispatcher[P, M]) Start() *Dispatcher[P, M] {
|
||||
if ch := d.closedHandler.Load(); ch != nil {
|
||||
(*ch)(&Action[P, M]{d: d, unlock: true})
|
||||
}
|
||||
close(d.abort)
|
||||
}(d)
|
||||
return d
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user