diff --git a/bento_beacon/network/network_config.py b/bento_beacon/network/network_config.py index 7cc1baed..9a0213dd 100644 --- a/bento_beacon/network/network_config.py +++ b/bento_beacon/network/network_config.py @@ -10,10 +10,14 @@ "https://ichange.bento.sd4h.ca/api/beacon", # "https://qa.bento.sd4h.ca/api/beacon/", # "https://bentov2.local/api/beacon", - # "https://renata.bento.sd4h.ca/api/beacon", + "https://renata.bento.sd4h.ca/api/beacon", + "https://signature.bento.sd4h.ca/api/beacon", + # "https://bentov2.local/api/beacon" ] -NETWORK_TIMEOUT = 30 +NETWORK_INIT_TIMEOUT = 30 +NETWORK_QUERY_WITH_VARIANTS_TIMEOUT = 2 * 60 +NETWORK_QUERY_WITHOUT_VARIANTS_TIMEOUT = 30 VALID_ENDPOINTS = ["analyses", "biosamples", "cohorts", "datasets", "g_variants", "individuals", "runs", "overview"] diff --git a/bento_beacon/network/utils.py b/bento_beacon/network/utils.py index c67803b0..4f94ddac 100644 --- a/bento_beacon/network/utils.py +++ b/bento_beacon/network/utils.py @@ -2,7 +2,7 @@ import requests from urllib.parse import urlsplit, urlunsplit from json import JSONDecodeError -from .network_config import BEACONS, NETWORK_TIMEOUT +from .network_config import BEACONS, NETWORK_INIT_TIMEOUT from ..utils.exceptions import APIException, InvalidQuery from ..utils.beacon_response import beacon_count_response @@ -18,9 +18,9 @@ def network_beacon_call(method, url, payload=None): try: if method == "GET": - r = requests.get(url, timeout=NETWORK_TIMEOUT) + r = requests.get(url, timeout=NETWORK_INIT_TIMEOUT) else: - r = requests.post(url, json=payload, timeout=NETWORK_TIMEOUT) + r = requests.post(url, json=payload, timeout=NETWORK_INIT_TIMEOUT) beacon_response = r.json() except (requests.exceptions.RequestException, JSONDecodeError) as e: