Return 0 seconds if timeout seconds is negative

This commit is contained in:
jesopo 2019-06-24 17:22:08 +01:00
parent 3bc1eb8b8b
commit a1cc2e778c

View file

@ -207,7 +207,7 @@ class Bot(object):
timeouts.append(self.next_read_timeout())
timeouts.append(self.cache.next_expiration())
min_secs = min([timeout for timeout in timeouts if not timeout == None])
return min_secs
return max([min_secs, 0])
def disconnect(self, server: IRCServer.Server):
del self.servers[server.fileno()]