From 5d1e254915a9f1fb6d164f05231cee0fdeda9d89 Mon Sep 17 00:00:00 2001 From: Tomasz Spyrka Date: Fri, 23 Dec 2022 23:41:44 +0100 Subject: [PATCH] Convert timeout to ms when using poll method --- kubernetes/base/stream/ws_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kubernetes/base/stream/ws_client.py b/kubernetes/base/stream/ws_client.py index 15cc3945f..4a7356a6d 100644 --- a/kubernetes/base/stream/ws_client.py +++ b/kubernetes/base/stream/ws_client.py @@ -182,6 +182,8 @@ class WSClient: 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: