From 2bcc9a514b231618c740c72d9fdc7e11fa4a226b Mon Sep 17 00:00:00 2001 From: Big Blue Meeting <64282788+bigbluemeeting@users.noreply.github.com> Date: Sat, 22 Aug 2020 03:41:01 +0500 Subject: [PATCH] Add timeout of 10 seconds This library does not have a timeout and python does not have a default timeout in the CPython implementation, hence if this gets stuck for some reason and in practice it does get stuck often enough... then it hangs there forever waiting. So we need to time it out eventually. --- bigbluebutton_api_python/bigbluebutton.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigbluebutton_api_python/bigbluebutton.py b/bigbluebutton_api_python/bigbluebutton.py index b300cbf..02b31a5 100644 --- a/bigbluebutton_api_python/bigbluebutton.py +++ b/bigbluebutton_api_python/bigbluebutton.py @@ -132,9 +132,9 @@ def __send_api_request(self, api_call, params={}, data=None): # if data is none, then we send a GET request, if not, then we send a POST request if data is None: - response = urlopen(url).read() + response = urlopen(url, timeout=10).read() else: - response = urlopen(url, data=urlencode(data).encode()).read() + response = urlopen(url, timeout=10, data=urlencode(data).encode()).read() try: rawXml = parse(response)["response"]