From c89bd74a4807626f238405a90fff19a2bffec0e9 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 6 Jun 2019 23:45:33 +0100 Subject: select.poll, as opposed to select.epoll, uses milliseconds not seconds for timeout --- src/IRCBot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/IRCBot.py') diff --git a/src/IRCBot.py b/src/IRCBot.py index 9c563f71..9d47b33e 100644 --- a/src/IRCBot.py +++ b/src/IRCBot.py @@ -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) -- cgit v1.3.1-10-gc9f91