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()