check length of mail list before reading mail

This commit is contained in:
2024-03-29 19:38:00 +01:00
parent eb0c04be0b
commit c1cb4b4d2f
+3 -2
View File
@@ -172,7 +172,8 @@ class AppointmentRequestSender(threading.Thread):
self.logger.info("try to remove success contact from list to retrieve mails") self.logger.info("try to remove success contact from list to retrieve mails")
self.list_to_retrieve_mails.remove(con) self.list_to_retrieve_mails.remove(con)
except Exception as e: 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) print(e)
else: else:
can_continue = RequestResult.COOKIES_ERROR can_continue = RequestResult.COOKIES_ERROR
@@ -208,7 +209,7 @@ class AppointmentRequestSender(threading.Thread):
self.channel.start_consuming() self.channel.start_consuming()
def retreive_invalidate_urls(self): 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") self.logger.info("will retreive_invalidate_urls")
time.sleep(30) time.sleep(30)
_mail_list = MONGO_STORE_MANAGER.get_destination_emails() _mail_list = MONGO_STORE_MANAGER.get_destination_emails()