tweak force-expiration behavior

This commit is contained in:
Shivaram Lingamneni 2021-03-10 14:05:12 -05:00
parent 05d8f44198
commit b26cd91715

@ -628,7 +628,9 @@ func (irc *Connection) unregisterLabel(labelStr string) {
}
// expire open batches from the server that weren't closed in a
// timely fashion
// timely fashion. `force` expires all label callbacks regardless
// of time created (so they can be cleaned up when the connection
// fails).
func (irc *Connection) expireBatches(force bool) {
var failedCallbacks []LabelCallback
defer func() {
@ -649,7 +651,7 @@ func (irc *Connection) expireBatches(force bool) {
}
for batchID, bip := range irc.batches {
if force || now.Sub(bip.createdAt) > irc.KeepAlive {
if now.Sub(bip.createdAt) > irc.KeepAlive {
delete(irc.batches, batchID)
}
}