Skip to content

Commit

Permalink
change: add timeout to requests.(get|put)
Browse files Browse the repository at this point in the history
  • Loading branch information
utnapischtim committed Oct 2, 2022
1 parent ca13b80 commit cee7b60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions invenio_alma/services/alma.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def get(self, url):
:return str: response content
"""
response = requests.get(url, headers=self.headers)
response = requests.get(url, headers=self.headers, timeout=10)
if response.status_code >= 400:
raise AlmaAPIError(code=response.status_code, msg=response.text)
return self.extract_alma_records(response.text)
Expand All @@ -155,7 +155,7 @@ def put(self, url, data):
:return str: response content
"""
response = requests.put(url, data, headers=self.headers)
response = requests.put(url, data, headers=self.headers, timeout=10)
if response.status_code >= 400:
raise AlmaRESTError(code=response.status_code, msg=response.text)
return response.text
Expand Down

0 comments on commit cee7b60

Please sign in to comment.