File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 1919)
2020@transaction .atomic ()
2121def send_pending_email (self , sent_email_id : int ):
22- email_backend_connection = get_connection ()
22+ logger .info (
23+ "Sending sent_email=%s (retry=%s of %s)" ,
24+ sent_email_id ,
25+ self .request .retries ,
26+ self .max_retries ,
27+ )
2328
2429 sent_email = (
2530 SentEmail .objects .select_for_update (skip_locked = True )
@@ -31,6 +36,8 @@ def send_pending_email(self, sent_email_id: int):
3136 if not sent_email :
3237 return
3338
39+ email_backend_connection = get_connection ()
40+
3441 if self .request .retries >= self .max_retries - 1 :
3542 sent_email .mark_as_failed ()
3643 logger .error (
@@ -39,8 +46,6 @@ def send_pending_email(self, sent_email_id: int):
3946 )
4047 return
4148
42- logger .info ("Sending sent_email=%s" , sent_email .id )
43-
4449 message_id = send_email (sent_email , email_backend_connection )
4550 sent_email .mark_as_sent (message_id )
4651
You can’t perform that action at this time.
0 commit comments