Skip to content

Commit

Permalink
Convert timeout to ms when using poll method
Browse files Browse the repository at this point in the history
  • Loading branch information
t-yrka committed Dec 23, 2022
1 parent 5a96bbc commit fd13fc8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kubernetes/base/stream/ws_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ def update(self, timeout=0):
if hasattr(select, "poll"):
poll = select.poll()
poll.register(self.sock.sock, select.POLLIN)
if timeout is not None:
timeout *= 1_000 # poll method uses milliseconds as the time unit
r = poll.poll(timeout)
poll.unregister(self.sock.sock)
else:
Expand Down

0 comments on commit fd13fc8

Please sign in to comment.