Skip to content

Commit

Permalink
More timeouts. See #454
Browse files Browse the repository at this point in the history
  • Loading branch information
breyten committed Feb 13, 2024
1 parent 5a677e1 commit 38b069f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ocd_backend/extractors/goapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, *args, **kwargs):
def _request(self, path):
log.debug(f'Now retrieving: {urljoin(self.base_url, path)}')
resp = self.http_session.get(
urljoin(self.base_url, path), verify=False)
urljoin(self.base_url, path), timeout=(3, 5), verify=False)

if resp.status_code == 200:
static_json = json.loads(resp.content)
Expand Down
2 changes: 1 addition & 1 deletion ocd_backend/extractors/gv.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _fetch(self, url):
'key': self.key,
'hash': self.hash,
}
return self.http_session.get('{}&{}'.format(url, parse.urlencode(auth)), verify=False)
return self.http_session.get('{}&{}'.format(url, parse.urlencode(auth)), timeout=(3, 5), verify=False)


class GreenValleyExtractor(GreenValleyBaseExtractor):
Expand Down
2 changes: 1 addition & 1 deletion ocd_backend/extractors/paging.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def run(self):

# Retrieve the static content from the source
try:
r = self.http_session.get(next_url, verify=False)
r = self.http_session.get(next_url, timeout=(3, 5), verify=False)
static_content = r.content
except Exception:
static_content = ''
Expand Down
4 changes: 2 additions & 2 deletions ocd_backend/extractors/parlaeus.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, *args, **kwargs):
self.rid = self.source_definition['session_id']

def get_response(self, url):
response = self.http_session.get(url).json()
response = self.http_session.get(url, timeout=(3, 5)).json()
if response['status'] != 200:
log.error(f'[{self.source_definition["key"]}] Parlaeus request error: {response["message"]}')
return response
Expand All @@ -39,7 +39,7 @@ def run(self):
self.base_url,
meeting['agid'],
)
resp = self.http_session.get(url + '&rid=%s' % self.rid)
resp = self.http_session.get(url + '&rid=%s' % self.rid, timeout=(3, 5))
resp.raise_for_status()

meeting_data = resp.json()
Expand Down

0 comments on commit 38b069f

Please sign in to comment.