Skip to content

Commit

Permalink
Merge pull request #3300 from MaggieFero/MaggieFero-add-timeouts-to-r…
Browse files Browse the repository at this point in the history
…equests.get

Add timeouts to requests.get
  • Loading branch information
mouse-reeve authored Mar 2, 2024
2 parents 354388c + 50b811d commit 218171e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions bookwyrm/activitypub/base_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ def get_activitypub_data(url):
"Date": now,
"Signature": make_signature("get", sender, url, now),
},
timeout=15,
)
except requests.RequestException:
raise ConnectorException()
Expand Down
2 changes: 1 addition & 1 deletion bookwyrm/isbn/isbn.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class IsbnHyphenator:

def update_range_message(self) -> None:
"""Download the range message xml file and save it locally"""
response = requests.get(self.__range_message_url)
response = requests.get(self.__range_message_url, timeout=15)
with open(self.__range_file_path, "w", encoding="utf-8") as file:
file.write(response.text)
self.__element_tree = None
Expand Down

0 comments on commit 218171e

Please sign in to comment.