Add timeout to requests calls

This commit is contained in:
pixeebot[bot]
2025-03-17 03:07:24 +00:00
committed by GitHub
parent 77b9701b5e
commit 96a21928a9

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