select.poll, as opposed to select.epoll, uses milliseconds not seconds for

timeout
This commit is contained in:
jesopo 2019-06-06 23:45:33 +01:00
parent 53262d4f36
commit c89bd74a48

View file

@ -160,7 +160,8 @@ class Bot(object):
timeouts.append(self.next_ping())
timeouts.append(self.next_read_timeout())
timeouts.append(self.cache.next_expiration())
return 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*1000 # return milliseconds
def register_read(self, server: IRCServer.Server):
self.poll.modify(server.fileno(), select.POLLIN)