Skip to content

Commit

Permalink
Modified iris.data.urls_hek() to make it more robust to network err…
Browse files Browse the repository at this point in the history
…ors.
  • Loading branch information
byrdie committed Feb 3, 2024
1 parent cb27261 commit 957fd5a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion iris/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ def urls_hek(
limit=limit,
)

response = requests.get(query, timeout=5).json()
response = None
while response is None:
try:
response = requests.get(query, timeout=5).json()
except requests.exceptions.RequestException: # pragma: no cover
pass

result = []
for event in response["Events"]:
Expand Down

0 comments on commit 957fd5a

Please sign in to comment.