poll() takes times in ms not seconds

This commit is contained in:
Kovid Goyal 2022-06-13 18:51:35 +05:30
parent f0d4952055
commit 8fb24fbc1e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -164,7 +164,7 @@ class PrewarmProcess:
input_buf = b''
st = time.monotonic()
while time.monotonic() - st < timeout:
for (fd, event) in self.poll.poll(0.2):
for (fd, event) in self.poll.poll(200):
if event & error_events:
raise PrewarmProcessFailed('Failed doing I/O with prewarm process')
if fd == self.read_from_process_fd and event & select.POLLIN:
@ -192,7 +192,7 @@ class PrewarmProcess:
st = time.monotonic()
while time.monotonic() - st < timeout and output_buf:
self.poll_to_send(bool(output_buf))
for (fd, event) in self.poll.poll(0.2):
for (fd, event) in self.poll.poll(200):
if event & error_events:
raise PrewarmProcessFailed('Failed doing I/O with prewarm process: {event}')
if fd == self.write_to_process_fd and event & select.POLLOUT: