More explicitly require throttle_done() only for _queued_lines

This commit is contained in:
jesopo 2019-05-31 15:32:55 +01:00
parent 4698ea6f78
commit f2cf86b8c0
2 changed files with 4 additions and 1 deletions

View file

@ -268,7 +268,8 @@ class Bot(object):
self.log.warn(
"Disconnected from %s, reconnecting in %d seconds",
[str(server), reconnect_delay])
elif (server.socket.waiting_send() and
elif server.socket.waiting_immediate_send() or (
server.socket.waiting_send() and
server.socket.throttle_done()):
self.register_both(server)

View file

@ -153,6 +153,8 @@ class Socket(IRCObject.Object):
def waiting_send(self) -> bool:
return bool(len(self._write_buffer)) or bool(len(self._queued_lines))
def waiting_immediate_send(self) -> bool:
return bool(len(self._write_buffer))
def throttle_done(self) -> bool:
return self.send_throttle_timeout() == 0