Skip to content

Commit

Permalink
Merge 37a6924 into 5b70145
Browse files Browse the repository at this point in the history
  • Loading branch information
dichn committed Sep 2, 2021
2 parents 5b70145 + 37a6924 commit aea0907
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ubipop/_pulp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

HTTP_TOTAL_RETRIES = int(os.environ.get("UBIPOP_HTTP_TOTAL_RETRIES", 10))
HTTP_RETRY_BACKOFF = float(os.environ.get("UBIPOP_HTTP_RETRY_BACKOFF", 1))
HTTP_TIMEOUT = int(os.environ.get("UBIPOP_HTTP_TIMEOUT", 120))


class UnsupportedTypeId(Exception):
Expand Down Expand Up @@ -77,9 +78,13 @@ def do_request(self, req_type, url, data=None):
req_url = urljoin(self.base_url, url)

if req_type == "post":
ret = self.local.session.post(req_url, json=data, verify=not self.insecure)
ret = self.local.session.post(
req_url, json=data, verify=not self.insecure, timeout=HTTP_TIMEOUT
)
elif req_type == "get":
ret = self.local.session.get(req_url, verify=not self.insecure)
ret = self.local.session.get(
req_url, verify=not self.insecure, timeout=HTTP_TIMEOUT
)
else:
ret = None

Expand Down

0 comments on commit aea0907

Please sign in to comment.