read mail after request

This commit is contained in:
2024-03-21 17:26:42 +01:00
parent dead188a69
commit 9a238eb642
3 changed files with 17 additions and 11 deletions
@@ -70,6 +70,7 @@ class AppointmentRequestSender(threading.Thread):
self.contact_list = sub_contact_list
self.queue_name = queue_name
self.proxy_to_use_list = proxy_to_use_list
self.already_read_emails = False
def set_up_connection(self):
self.connection = pika.BlockingConnection(
@@ -193,6 +194,7 @@ class AppointmentRequestSender(threading.Thread):
self.channel.start_consuming()
def retreive_invalidate_urls(self):
if not self.already_read_emails:
self.logger.info("will retreive_invalidate_urls")
_mail_list = MONGO_STORE_MANAGER.get_destination_emails()
_mail_list_filtred = []
@@ -202,3 +204,6 @@ class AppointmentRequestSender(threading.Thread):
_mail_list_filtred.append(mail)
self.logger.info("will call find_links_to_validate_from_mail_list, size = " + str(len(_mail_list_filtred)))
find_links_to_validate_from_mail_list(_mail_list_filtred)
self.already_read_emails = True
else:
self.logger.info("already read emails, will not retreive_invalidate_urls")
+2 -2
View File
@@ -64,10 +64,10 @@ def send_appointment_request(message_queue_name, _contact_list):
if __name__ == '__main__':
contacts_file_path = '~/Desktop/contact_list_2024-03-20.xlsx'
contacts_file_path = '~/Desktop/contact_list_2024-03-19.xlsx'
_contact_list = read_contacts(contacts_file_path)
_contact_list_to_book = filter_contacts(_contact_list)
_segment_number = 2
_segment_number = 1
logger.info("{} contacts to book".format(len(_contact_list_to_book)))
last_thread = None
for i in range(0, _segment_number):
+1
View File
@@ -94,6 +94,7 @@ class Sender:
self.logger.info("body in json:{}".format(json.dumps(self.received_dict)))
self.cookiesPublisher.publish_body(json.dumps(self.received_dict))
# self.cookie_str = new_coolies_str
self.logger.info("successful request, mail:{}".format(contact.mail))
return RequestResult.SUCCESS
else:
print(response.text)