Add timeout to requests calls

This commit is contained in:
pixeebot[bot]
2025-01-28 03:09:49 +00:00
committed by GitHub
parent 7aa706d12a
commit 96857ad1d4
8 changed files with 14 additions and 14 deletions

View File

@@ -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)