API freezing?

7 years 1 month ago #135 by jluebbe
API freezing? was created by jluebbe
Hi,
I am calling the Python-API nearly every 5 seconds in a while loop. Sometimes it seems to be frozen. My script stopped data acquisition this morning and was terminated in the evening by pressing CTRL+C. I would prefer if the API throws an exception after a timeout instead of hanging infinitely.
This is the errorlog:
File "json-conversion.py", line 91, in <module>
states = api.get_states()
File "build/bdist.linux-armv7l/egg/opensky_api.py", line 138, in
get_states
File "build/bdist.linux-armv7l/egg/opensky_api.py", line 102, in _get_json
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 60, in get
return request('get', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/api.py", line 49, in
request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 457, in
request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 569, in
send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 362, in
send
timeout=timeout
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line
516, in urlopen
body=body, headers=headers)
File "/usr/lib/python2.7/dist-packages/urllib3/connectionpool.py", line
331, in _make_request
httplib_response = conn.getresponse(buffering=True)
File "/usr/lib/python2.7/httplib.py", line 1111, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 444, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 400, in _read_status
line = self.fp.readline(_MAXLINE + 1)
File "/usr/lib/python2.7/socket.py", line 476, in readline
data = self._sock.recv(self._rbufsize)
File "/usr/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line
188, in recv
data = self.connection.recv(*args, **kwargs)
KeyboardInterrupt
The following user(s) said Thank You: valecosmos

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
This website uses cookies to offer you the best experience of our services. By using this website you agree to our privacy policy!