diff --git a/mail/lan_mail_helper.py b/mail/lan_mail_helper.py index 3e2c41e..c7dd1a3 100644 --- a/mail/lan_mail_helper.py +++ b/mail/lan_mail_helper.py @@ -9,6 +9,7 @@ from mail.mail_reader_all_contacts import find_links_to_validate_from_mail_list from models.mail_pojo import MailAddress host = "https://authhk.bhdata.com:30015/bhmailer?uid=482391396&sign=32d7748da00047b9a1054c81a5750365" +is_checking = False HERMES_EMAIL = "no-reply@hermes.com" @@ -92,16 +93,20 @@ def check_confirmed_mails(): def check_all_need_to_check_emails(): - logger = logging.getLogger() - _mail_list_before_filter = get_mail_list_to_check() - _mails = filter_mail_with_links(_mail_list_before_filter) - for _mail in _mails: - if "outlook.com" in _mail or "hotmail.com" in _mail: - check_mail(_mail) - time.sleep(2) + global is_checking + if not is_checking: + is_checking = True + logger = logging.getLogger() + _mail_list_before_filter = get_mail_list_to_check() + _mails = filter_mail_with_links(_mail_list_before_filter) + 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) + _mail_list = [MailAddress("saigecong1990@pissmail.com", "cvExXKOP8oY1D@")] + find_links_to_validate_from_mail_list(_mail_list, logger) + is_checking = False def try_to_check_all_mails(): @@ -117,7 +122,7 @@ def try_to_check_all_mails(): if __name__ == '__main__': - # check_all_need_to_check_emails() - try_to_check_all_mails() + check_all_need_to_check_emails() + # try_to_check_all_mails() # check_confirmed_mails() # check_appointment_link_mail("hcunlvi533@outlook.com") diff --git a/request_sender_test.py b/request_sender_test.py index 53280ab..fa6475c 100644 --- a/request_sender_test.py +++ b/request_sender_test.py @@ -101,8 +101,12 @@ 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-07-11.xlsx'] - # file_list = ['~/Desktop/contact_list_all_studio.xlsx'] + # file_list = ['~/Desktop/contact_list_2025-07-15.xlsx'] + # file_list = ['~/Desktop/contact_list_2025-07-28.xlsx'] + # file_list = ['~/Desktop/contact_list_2025-06-23.xlsx'] + # file_list = ['~/Desktop/contact_list_2025-03-11.xlsx'] + # file_list = ['~/Desktop/contact_list_2025-05-21.xlsx'] + file_list = ['~/Desktop/contact_list_2025-08-14.xlsx'] # file_list = ['~/Desktop/real_name_contacts_100_27_06.xlsx'] - send_request_for_file_list(file_list=file_list, thread_number=20, + send_request_for_file_list(file_list=file_list, thread_number=10, data_queue_name=MORNING_DATA_CACHE, stop_at_hour=19, stop_at_mins=50) diff --git a/workers/link_validator_with_provided_list.py b/workers/link_validator_with_provided_list.py index ab4662b..e3574c3 100644 --- a/workers/link_validator_with_provided_list.py +++ b/workers/link_validator_with_provided_list.py @@ -241,8 +241,8 @@ def validate_all_links(_contact_serial_list): # else: # _segment_number = 1 _thread_list = [] - if len(_first_25_percent_links) >= 10: - _segment_number = 10 + if len(_first_25_percent_links) >= 20: + _segment_number = 20 else: _segment_number = len(_first_25_percent_links) for i in range(0, _segment_number):