Skip to content

Commit fd13fc8

Browse files
committed
Convert timeout to ms when using poll method
1 parent 5a96bbc commit fd13fc8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kubernetes/base/stream/ws_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ def update(self, timeout=0):
182182
if hasattr(select, "poll"):
183183
poll = select.poll()
184184
poll.register(self.sock.sock, select.POLLIN)
185+
if timeout is not None:
186+
timeout *= 1_000 # poll method uses milliseconds as the time unit
185187
r = poll.poll(timeout)
186188
poll.unregister(self.sock.sock)
187189
else:

0 commit comments

Comments
 (0)