Skip to content
Merged
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
8 changes: 6 additions & 2 deletions marble_node_registry/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@ def update_registry() -> None:
version_url = link["href"]
try:
# This assumes the json is initially valid according to the schema
services_response = requests.get(services_url, headers={"Accept": "application/json"})
version_response = requests.get(version_url, headers={"Accept": "application/json"})
services_response = requests.get(services_url, headers={"Accept": "application/json"}, timeout=10)
version_response = requests.get(version_url, headers={"Accept": "application/json"}, timeout=10)
except requests.exceptions.ConnectionError as e:
# if either url fails, report that the node is offline
data["status"] = "offline"
sys.stderr.write(f"unable to access node named {name}. Error message: {e}\n")
continue
except requests.exceptions.Timeout as e:
data["status"] = "unresponsive"
sys.stderr.write(f"node named '{name}' is unrespsonsive. Error message: {e}\n")
continue

try:
data["version"] = version_response.json().get("version", "unknown")
Expand Down