mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Add timeout to all Requests calls
Use a default timeout of 30 seconds for all requests, and add a REQUESTS_TIMEOUT Anymail setting to override. (I'm making a judgement call that this is not a breaking change in the real world, and not bumping the major version. Theoretically, it could affect you if your network somehow takes >30s to connect to your ESP, but eventually succeeds. If so, set REQUESTS_TIMEOUT to None to restore the earlier behavior.) Fixes #80.
This commit is contained in:
@@ -115,7 +115,7 @@ class MailjetPayload(RequestsPayload):
|
||||
if template_id and not self.data.get("FromEmail"):
|
||||
response = self.backend.session.get(
|
||||
"%sREST/template/%s/detailcontent" % (self.backend.api_url, template_id),
|
||||
auth=self.auth
|
||||
auth=self.auth, timeout=self.backend.timeout
|
||||
)
|
||||
self.backend.raise_for_status(response, None, self.message)
|
||||
json_response = self.backend.deserialize_json_response(response, None, self.message)
|
||||
|
||||
Reference in New Issue
Block a user