Skip to content

Commit dcdade2

Browse files
committed
Set separate read and connect timeouts.
1 parent a9af2ff commit dcdade2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rnacentral/portal/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ def check_api():
696696
test_endpoint = 'https://rnacentral.org/api/v1/rna/'
697697
test_id = 'URS0000000001'
698698
try:
699-
api_response = requests.get(f"{test_endpoint}{test_id}", timeout=5)
699+
api_response = requests.get(f"{test_endpoint}{test_id}", timeout=(10, 20))
700700
if api_response.status_code == 200:
701701
return HttpResponse("OK", status=200)
702702
return HttpResponse("API is down", status=503)
@@ -709,7 +709,7 @@ def check_search():
709709
search_endpoint = 'https://rnacentral.org/search'
710710
test_query = 'RNA'
711711
try:
712-
search_response = requests.get(f"{search_endpoint}?q={test_query}", timeout=5)
712+
search_response = requests.get(f"{search_endpoint}?q={test_query}", timeout=(10, 20))
713713
if search_response.status_code == 200:
714714
return HttpResponse("OK", status=200)
715715
return HttpResponse("Search is down", status=503)

0 commit comments

Comments
 (0)