make sure non-label batches expire as well
This commit is contained in:
parent
6d11cde149
commit
b2a42a4234
@ -134,8 +134,8 @@ func (irc *Connection) readLoop() {
|
||||
return
|
||||
}
|
||||
|
||||
if irc.labelNegotiated && time.Since(lastExpireCheck) > irc.Timeout {
|
||||
irc.expireLabels(false)
|
||||
if irc.batchNegotiated && time.Since(lastExpireCheck) > irc.Timeout {
|
||||
irc.expireBatches(false)
|
||||
lastExpireCheck = time.Now()
|
||||
}
|
||||
}
|
||||
@ -307,7 +307,7 @@ func (irc *Connection) waitForStop() {
|
||||
irc.socket.Close()
|
||||
}
|
||||
|
||||
irc.expireLabels(true)
|
||||
irc.expireBatches(true)
|
||||
}
|
||||
|
||||
// Quit the current connection and disconnect from the server
|
||||
|
@ -627,7 +627,9 @@ func (irc *Connection) unregisterLabel(labelStr string) {
|
||||
delete(irc.labelCallbacks, label)
|
||||
}
|
||||
|
||||
func (irc *Connection) expireLabels(force bool) {
|
||||
// expire open batches from the server that weren't closed in a
|
||||
// timely fashion
|
||||
func (irc *Connection) expireBatches(force bool) {
|
||||
var failedCallbacks []LabelCallback
|
||||
defer func() {
|
||||
for _, bcb := range failedCallbacks {
|
||||
|
Loading…
Reference in New Issue
Block a user