Skip to content

Commit 52ebd67

Browse files
chaenweb-flow
authored andcommitted
sweep: #7967 fix (RSS): add a timeout to query gocdb
1 parent 86ecf2a commit 52ebd67

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/DIRAC/Core/LCG/GOCDBClient.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def getHostnameDowntime(self, hostname, startDate=None, ongoing=False):
214214

215215
try:
216216
response = requests.get(
217-
"https://goc.egi.eu/gocdbpi/public/?method=get_downtime&topentity=" + params, verify=caPath
217+
"https://goc.egi.eu/gocdbpi/public/?method=get_downtime&topentity=" + params, verify=caPath, timeout=20
218218
)
219219
response.raise_for_status()
220220
except requests.exceptions.RequestException as e:
@@ -270,7 +270,7 @@ def _downTimeCurlDownload(self, entity=None, startDate=None):
270270
gocdb_ep = gocdb_ep + when + gocdbpi_startDate + "&scope="
271271

272272
caPath = getCAsLocation()
273-
dtPage = requests.get(gocdb_ep, verify=caPath)
273+
dtPage = requests.get(gocdb_ep, verify=caPath, timeout=20)
274274

275275
dt = dtPage.text
276276

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

297297
caPath = getCAsLocation()
298-
service_endpoint_page = requests.get(gocdb_ep, verify=caPath)
298+
service_endpoint_page = requests.get(gocdb_ep, verify=caPath, timeout=20)
299299

300300
return service_endpoint_page.text
301301

0 commit comments

Comments
 (0)