How to configure timeouts for requests when using jwt for box?
How does one configure request timeout with the box python sdk to ensure that the system does not hang forever incase of noresponse from server?
The interfaces for users,events etc in Client class etc do to take in kwargs arguments where the timeout can be specified. This is the definition for the users method:
def users(self, limit=None, offset=0, filter_term=None):
url = '{0}/users'.format(API.BASE_API_URL)
params = dict(offset=offset)
if limit is not None:
params['limit'] = limit
if filter_term is not None:
params['filter_term'] = filter_term
box_response = self._session.get(url, params=params)
response = box_response.json()
return [User(self._session, item['id'], item) for item in response['entries']]
The session.get(url,params, **kwargs) from BoxSession class gives an option to provide timeout, however it is not being used here. Also what about the request made when authenticating jwt instance using authenticate_instance? It also does not have a timeout field ? Shouldnt these timeouts be configurable by the user?
Please sign in to leave a comment.
Comments
0 comments