Skip to content

Commit c4d0264

Browse files
committed
perf(camel): set a timeout on semantic scholar toolkit HTTP calls
1 parent a2691e4 commit c4d0264

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

camel/toolkits/semantic_scholar_toolkit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def fetch_paper_data_title(
6767
url = f"{self.base_url}/paper/search"
6868
query_params = {"query": paper_title, "fields": ",".join(fields)}
6969
try:
70-
response = requests.get(url, params=query_params)
70+
response = requests.get(url, params=query_params, timeout=10.0)
7171
response.raise_for_status()
7272
return response.json()
7373
except requests.exceptions.RequestException as e:
@@ -115,7 +115,7 @@ def fetch_paper_data_id(
115115
url = f"{self.base_url}/paper/{paper_id}"
116116
query_params = {"fields": ",".join(fields)}
117117
try:
118-
response = requests.get(url, params=query_params)
118+
response = requests.get(url, params=query_params, timeout=10.0)
119119
response.raise_for_status()
120120
return response.json()
121121
except requests.exceptions.RequestException as e:

0 commit comments

Comments
 (0)