aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IRCBot.py4
-rw-r--r--IRCServer.py2
2 files changed, 5 insertions, 1 deletions
diff --git a/IRCBot.py b/IRCBot.py
index 0cf36fd3..77ee00e3 100644
--- a/IRCBot.py
+++ b/IRCBot.py
@@ -95,7 +95,9 @@ class Bot(object):
def next_ping(self):
timeouts = []
for server in self.servers.values():
- timeouts.append(server.until_next_ping())
+ timeout = server.until_next_ping()
+ if not timeout == None:
+ timeouts.append(timeout)
if not timeouts:
return None
return min(timeouts)
diff --git a/IRCServer.py b/IRCServer.py
index 1c622e94..906ba572 100644
--- a/IRCServer.py
+++ b/IRCServer.py
@@ -228,6 +228,8 @@ class Server(object):
return decoded_lines
def until_next_ping(self):
+ if self.ping_sent:
+ return None
return max(0, (self.last_read+PING_INTERVAL_SECONDS
)-time.monotonic())
def ping_due(self):