diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0a598f9..c0af32c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ jobs: run: | # PyYaml is required until docker-compose is migrated to v2 pip install pyyaml==5.3.1 - pip install docker==6.1.3 docker-compose + pip install docker==6.1.3 docker-compose requests==2.31.0 poetry install --no-interaction --no-ansi docker-compose version poetry run python -m pytest diff --git a/app/lib/node_utils.py b/app/lib/node_utils.py index d15fe27..53e5618 100644 --- a/app/lib/node_utils.py +++ b/app/lib/node_utils.py @@ -10,7 +10,7 @@ def get_node_health(node_http_endpoint): try: - return requests.get(node_http_endpoint + '/health', headers={'Content-type': 'application/json'}) + return requests.get(node_http_endpoint + '/health', headers={'Content-type': 'application/json'}, timeout=1) except Exception as err: log.error("Failed to call /health on {}; Error: {}".format(node_http_endpoint, err)) return False diff --git a/app/lib/session_keys.py b/app/lib/session_keys.py index 735a154..863d5f6 100644 --- a/app/lib/session_keys.py +++ b/app/lib/session_keys.py @@ -11,7 +11,7 @@ def rotate_node_session_keys(node_http_endpoint): try: rotate_keys = requests.post(node_http_endpoint, data='{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}', - headers={'Content-type': 'application/json'}) + headers={'Content-type': 'application/json'}, timeout=10) if rotate_keys.status_code == 200: log.info("{} session keys rotated successfully".format(node_http_endpoint)) return rotate_keys.json()['result']