Skip to content

Commit

Permalink
fix (RSS): add a timeout to query gocdb
Browse files Browse the repository at this point in the history
  • Loading branch information
chaen committed Dec 20, 2024
1 parent 2c277f1 commit 5bdaaec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/DIRAC/Core/LCG/GOCDBClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def getHostnameDowntime(self, hostname, startDate=None, ongoing=False):

try:
response = requests.get(
"https://goc.egi.eu/gocdbpi/public/?method=get_downtime&topentity=" + params, verify=caPath
"https://goc.egi.eu/gocdbpi/public/?method=get_downtime&topentity=" + params, verify=caPath, timeout=20
)
response.raise_for_status()
except requests.exceptions.RequestException as e:
Expand Down Expand Up @@ -269,7 +269,7 @@ def _downTimeCurlDownload(self, entity=None, startDate=None):
gocdb_ep = gocdb_ep + when + gocdbpi_startDate + "&scope="

caPath = getCAsLocation()
dtPage = requests.get(gocdb_ep, verify=caPath)
dtPage = requests.get(gocdb_ep, verify=caPath, timeout=20)

dt = dtPage.text

Expand All @@ -294,7 +294,7 @@ def _getServiceEndpointCurlDownload(self, granularity, entity):
gocdb_ep = "https://goc.egi.eu/gocdbpi/public/?method=get_service_endpoint&" + granularity + "=" + entity

caPath = getCAsLocation()
service_endpoint_page = requests.get(gocdb_ep, verify=caPath)
service_endpoint_page = requests.get(gocdb_ep, verify=caPath, timeout=20)

return service_endpoint_page.text

Expand Down

0 comments on commit 5bdaaec

Please sign in to comment.