Add timeout to requests calls

This commit is contained in:
pixeebot[bot]
2024-12-11 03:35:50 +00:00
committed by GitHub
parent 77b9701b5e
commit fb55d08238

View File

@@ -216,7 +216,7 @@ class BrevoInboundWebhookView(BrevoBaseWebhookView):
# FUTURE: somehow defer download until attachment is accessed? # FUTURE: somehow defer download until attachment is accessed?
token = attachment["DownloadToken"] token = attachment["DownloadToken"]
url = urljoin(self.api_url, f"inbound/attachments/{quote(token, safe='')}") url = urljoin(self.api_url, f"inbound/attachments/{quote(token, safe='')}")
response = requests.get(url, headers={"api-key": self.api_key}) response = requests.get(url, headers={"api-key": self.api_key}, timeout=60)
response.raise_for_status() # or maybe just log and continue? response.raise_for_status() # or maybe just log and continue?
content = response.content content = response.content