Add pk.Option API

This commit is contained in:
Tnze
2022-12-06 02:14:38 +08:00
parent 516b3c2a8b
commit 55bf5eddbb
6 changed files with 107 additions and 50 deletions

View File

@ -118,7 +118,6 @@ func (k *KeepAlive) tickPlayer(c KeepAliveClient) {
elem, ok := k.listIndex[c]
if !ok {
panic(errors.New("keepalive: fail to tick player: client not found"))
return
}
if elem.Prev() == nil {
if !k.waitTimer.Stop() {
@ -156,7 +155,6 @@ func keepAliveSetTimer(l *list.List, timer *time.Timer, interval time.Duration)
}
}
timer.Reset(interval)
return
}
type keepAliveItem struct {