Adding timeout to requests
Closed this issue · 3 comments
I think it would be very useful to add the timeout to the requests.get
, requests.post
for all the API calls.
I just encounter an issue that the firewall was open from Castor server
to https://firecrest.cscs.ch. The exception throw is not very clear I think it will be much clear if the timeout can be set and caught in the pyfirecrest
.
Do you think adding it to the client Firecrest object would be enough or do you mean in every method (submit
, mv
etc)?
Since POST
and GET
they have almost the same input parameters, I propose requests.get(url=url, headers=headers, verify=self._verify)
can be a class method let's say self._requests_get
and having timeout
as the attribute of the class and used for _requests_get
/requests_post
. Or simply just a class attribute for every requests
call of every API.
Ok thanks for the suggestions, sounds good and easy to implement, I will make a pr this week.