Skip to content

Commit

Permalink
Merge pull request #9 from nicksinger/bump_timeout
Browse files Browse the repository at this point in the history
Bump connection timeouts to 60 seconds
  • Loading branch information
asdil12 authored Dec 13, 2023
2 parents d30403f + 199260a commit 1d45199
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion openqa_bugfetcher/issues/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BugzillaBaseIssue(BaseIssue):
def fetch(self, conf):
def json_rpc_get(url, method, params):
get_params = OrderedDict({"method": method, "params": json.dumps([params])})
return requests.get(url, params=get_params, timeout=10)
return requests.get(url, params=get_params, timeout=60)

issue_id = self.bugid.split("#")[1]
req = json_rpc_get(self.url, "Bug.get", {"ids": [issue_id]})
Expand Down
4 changes: 2 additions & 2 deletions openqa_bugfetcher/issues/bugzilla_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def rest_get_bug(issue_id):
cfg = conf["bugzilla"]
if cfg.get("api_key"):
get_params["api_key"] = cfg["api_key"]
return requests.get(url, params=get_params, timeout=10)
return requests.get(url, params=get_params, timeout=60)

req = rest_get_bug(issue_id)
data = req.json()
Expand All @@ -46,7 +46,7 @@ def rest_get_bug(issue_id):
else:
# Workaround for bugzilla API unavailable from non-employee accounts
url = f"https://bugzilla.suse.com/show_bug.cgi?id={issue_id}"
req = requests.get(url, timeout=10)
req = requests.get(url, timeout=60)
title = req.text.split("<title>", 1)[1].split("</title>", 1)[0]
assert title != "Access Denied", "Insufficient permission to access this bug"
if title in ("Invalid Bug ID", "Search by bug number"):
Expand Down
2 changes: 1 addition & 1 deletion openqa_bugfetcher/issues/github_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def fetch(self, conf):
auth = None
if "client_id" in conf["github"] and "client_secret" in conf["github"]:
auth = (conf["github"]["client_id"], conf["github"]["client_secret"])
req = requests.get(url, auth=auth, timeout=10)
req = requests.get(url, auth=auth, timeout=60)
assert req.status_code != 403, "Github ratelimiting"
if req.ok:
data = req.json()
Expand Down
2 changes: 1 addition & 1 deletion openqa_bugfetcher/issues/jira_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def fetch(self, conf):
issue_id = self.bugid.split("#")[1]
url = f"https://jira.suse.com/rest/api/2/issue/{issue_id}"
cred = conf["jira"]
req = requests.get(url, auth=(cred["user"], cred["pass"]), timeout=10)
req = requests.get(url, auth=(cred["user"], cred["pass"]), timeout=60)
if req.ok:
data = req.json()["fields"]
self.title = data["summary"]
Expand Down
2 changes: 1 addition & 1 deletion openqa_bugfetcher/issues/progress_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ProgressIssue(BaseIssue):
def fetch(self, conf):
issue_id = self.bugid.split("#")[1]
url = f"https://progress.opensuse.org/issues/{issue_id}.json"
req = requests.get(url, headers={"X-Redmine-API-Key": conf["progress"]["api_key"]}, timeout=10)
req = requests.get(url, headers={"X-Redmine-API-Key": conf["progress"]["api_key"]}, timeout=60)
if req.ok:
data = req.json()["issue"]
self.title = data["subject"]
Expand Down

0 comments on commit 1d45199

Please sign in to comment.