Return 0 seconds if timeout seconds is negative
This commit is contained in:
parent
3bc1eb8b8b
commit
a1cc2e778c
1 changed files with 1 additions and 1 deletions
|
@ -207,7 +207,7 @@ class Bot(object):
|
||||||
timeouts.append(self.next_read_timeout())
|
timeouts.append(self.next_read_timeout())
|
||||||
timeouts.append(self.cache.next_expiration())
|
timeouts.append(self.cache.next_expiration())
|
||||||
min_secs = min([timeout for timeout in timeouts if not timeout == None])
|
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):
|
def disconnect(self, server: IRCServer.Server):
|
||||||
del self.servers[server.fileno()]
|
del self.servers[server.fileno()]
|
||||||
|
|
Loading…
Reference in a new issue