From c1cb4b4d2f6045aeb52b8a64531900f43d3b2001 Mon Sep 17 00:00:00 2001 From: PAN Lei Date: Fri, 29 Mar 2024 19:38:00 +0100 Subject: [PATCH] check length of mail list before reading mail --- queue_message/appointmentrequestsender.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/queue_message/appointmentrequestsender.py b/queue_message/appointmentrequestsender.py index a1bbec6..118c69a 100644 --- a/queue_message/appointmentrequestsender.py +++ b/queue_message/appointmentrequestsender.py @@ -172,7 +172,8 @@ class AppointmentRequestSender(threading.Thread): self.logger.info("try to remove success contact from list to retrieve mails") self.list_to_retrieve_mails.remove(con) except Exception as e: - self.logger.info("exception while remove success contact from list to retrieve mails") + self.logger.info( + "exception while remove success contact from list to retrieve mails") print(e) else: can_continue = RequestResult.COOKIES_ERROR @@ -208,7 +209,7 @@ class AppointmentRequestSender(threading.Thread): self.channel.start_consuming() def retreive_invalidate_urls(self): - if not self.already_read_emails: + if not self.already_read_emails and len(self.list_to_retrieve_mails) > 0: self.logger.info("will retreive_invalidate_urls") time.sleep(30) _mail_list = MONGO_STORE_MANAGER.get_destination_emails()