Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_response(
'limit': 100,
'key': self.api_key,
}
response = requests.get(service_url, params=params)
response = requests.get(service_url, params=params, timeout=10)
results = []
for result in response.json().get('itemListElement', []):
tmp_result = result.get('result')
Expand Down
2 changes: 1 addition & 1 deletion libs/core/garf/core/api_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def get_response(
for param in request.filters:
key, value = param.split('=')
params[key.strip()] = value.strip()
response = requests.get(url, params=params, headers=kwargs)
response = requests.get(url, params=params, headers=kwargs, timeout=10)
if response.status_code == self.OK:
results = response.json()
if not isinstance(results, list):
Expand Down
4 changes: 2 additions & 2 deletions libs/executors/garf/executors/entrypoints/typer_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def execute(
'context': rest_context,
}
try:
response = requests.post(url=endpoint, json=request, headers=headers)
response = requests.post(url=endpoint, json=request, headers=headers, timeout=10)
response.raise_for_status()
except requests.exceptions.HTTPError as e:
raise exceptions.GarfExecutorError(
Expand All @@ -250,7 +250,7 @@ def execute(
'context': rest_context,
}
try:
response = requests.post(url=endpoint, json=request, headers=headers)
response = requests.post(url=endpoint, json=request, headers=headers, timeout=10)
response.raise_for_status()
except requests.exceptions.HTTPError as e:
raise exceptions.GarfExecutorError(
Expand Down
2 changes: 1 addition & 1 deletion libs/exporters/garf/exporter/entrypoints/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def healthcheck(host: str, port: int) -> bool:
Whether or not the check is successful.
"""
try:
res = requests.get(f'http://{host}:{port}/metrics/').text.split('\n')
res = requests.get(f'http://{host}:{port}/metrics/', timeout=5).text.split('\n')
except requests.exceptions.ConnectionError:
return False
last_exported = [r for r in res if 'export_completed_seconds 1' in r][
Expand Down