diff --git a/mail/lan_mail_helper.py b/mail/lan_mail_helper.py index 1bf9473..0a8e2ec 100644 --- a/mail/lan_mail_helper.py +++ b/mail/lan_mail_helper.py @@ -1,4 +1,5 @@ import logging +import random import time import requests @@ -70,6 +71,15 @@ def get_mail_list_to_check(): return _mail_list +def check_confirmed_mails(): + successful_items = MONGO_STORE_MANAGER.get_all_successful_items_for_day() + # _mail_list = [] + for _item in successful_items: + if "outlook" in _item.email or "hotmail" in _item.email: + check_mail(_item.email) + time.sleep(random.randint(1, 5)) + + def check_all_need_to_check_emails(): logger = logging.getLogger() _mail_list_before_filter = get_mail_list_to_check() @@ -77,10 +87,12 @@ def check_all_need_to_check_emails(): for _mail in _mails: if "outlook.com" in _mail or "hotmail.com" in _mail: check_mail(_mail) + time.sleep(2) _mail_list = [MailAddress("saigecong1990@pissmail.com", "cvExXKOP8oY1D@")] find_links_to_validate_from_mail_list(_mail_list, logger) if __name__ == '__main__': - check_all_need_to_check_emails() + # check_all_need_to_check_emails() + check_confirmed_mails() diff --git a/request_sender_test.py b/request_sender_test.py index 5a7cde3..53280ab 100644 --- a/request_sender_test.py +++ b/request_sender_test.py @@ -101,7 +101,8 @@ if __name__ == '__main__': # '~/Desktop/contact_list_2024-05-21.xlsx', # '~/Desktop/15_05_to_test.xlsx'] # file_list = ['~/Desktop/15_05_to_test.xlsx', '~/Desktop/16_05_to_test.xlsx'] - # file_list = ['~/Desktop/contact_list_2025-06-24.xlsx'] - file_list = ['~/Desktop/real_name_contacts_100_27_06.xlsx'] - send_request_for_file_list(file_list=file_list, thread_number=2, + file_list = ['~/Desktop/contact_list_2025-07-11.xlsx'] + # file_list = ['~/Desktop/contact_list_all_studio.xlsx'] + # file_list = ['~/Desktop/real_name_contacts_100_27_06.xlsx'] + send_request_for_file_list(file_list=file_list, thread_number=20, data_queue_name=MORNING_DATA_CACHE, stop_at_hour=19, stop_at_mins=50) diff --git a/scheduler_test.py b/scheduler_test.py index 0ca45aa..45bc1af 100644 --- a/scheduler_test.py +++ b/scheduler_test.py @@ -6,8 +6,8 @@ from request_sender_test import send_request_for_file_list def start_book_appointment(): - file_list = ['~/Desktop/contact_list_2025-06-27.xlsx'] - send_request_for_file_list(file_list=file_list, thread_number=50, + file_list = ['~/Desktop/contact_list_2025-07-11.xlsx'] + send_request_for_file_list(file_list=file_list, thread_number=60, data_queue_name=MORNING_DATA_CACHE, stop_at_hour=11, stop_at_mins=20)