mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 16:31:08 -05:00
Add timeout to requests calls
This commit is contained in:
@@ -189,7 +189,7 @@ class Command(BaseCommand):
|
||||
|
||||
def download_image(self, url):
|
||||
"""Download image from URL and return as Django File object"""
|
||||
response = requests.get(url)
|
||||
response = requests.get(url, timeout=60)
|
||||
if response.status_code == 200:
|
||||
img_temp = NamedTemporaryFile(delete=True)
|
||||
img_temp.write(response.content)
|
||||
|
||||
Reference in New Issue
Block a user