more threads for link validation
This commit is contained in:
+16
-11
@@ -9,6 +9,7 @@ from mail.mail_reader_all_contacts import find_links_to_validate_from_mail_list
|
|||||||
from models.mail_pojo import MailAddress
|
from models.mail_pojo import MailAddress
|
||||||
|
|
||||||
host = "https://authhk.bhdata.com:30015/bhmailer?uid=482391396&sign=32d7748da00047b9a1054c81a5750365"
|
host = "https://authhk.bhdata.com:30015/bhmailer?uid=482391396&sign=32d7748da00047b9a1054c81a5750365"
|
||||||
|
is_checking = False
|
||||||
|
|
||||||
HERMES_EMAIL = "no-reply@hermes.com"
|
HERMES_EMAIL = "no-reply@hermes.com"
|
||||||
|
|
||||||
@@ -92,16 +93,20 @@ def check_confirmed_mails():
|
|||||||
|
|
||||||
|
|
||||||
def check_all_need_to_check_emails():
|
def check_all_need_to_check_emails():
|
||||||
logger = logging.getLogger()
|
global is_checking
|
||||||
_mail_list_before_filter = get_mail_list_to_check()
|
if not is_checking:
|
||||||
_mails = filter_mail_with_links(_mail_list_before_filter)
|
is_checking = True
|
||||||
for _mail in _mails:
|
logger = logging.getLogger()
|
||||||
if "outlook.com" in _mail or "hotmail.com" in _mail:
|
_mail_list_before_filter = get_mail_list_to_check()
|
||||||
check_mail(_mail)
|
_mails = filter_mail_with_links(_mail_list_before_filter)
|
||||||
time.sleep(2)
|
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@")]
|
_mail_list = [MailAddress("saigecong1990@pissmail.com", "cvExXKOP8oY1D@")]
|
||||||
find_links_to_validate_from_mail_list(_mail_list, logger)
|
find_links_to_validate_from_mail_list(_mail_list, logger)
|
||||||
|
is_checking = False
|
||||||
|
|
||||||
|
|
||||||
def try_to_check_all_mails():
|
def try_to_check_all_mails():
|
||||||
@@ -117,7 +122,7 @@ def try_to_check_all_mails():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# check_all_need_to_check_emails()
|
check_all_need_to_check_emails()
|
||||||
try_to_check_all_mails()
|
# try_to_check_all_mails()
|
||||||
# check_confirmed_mails()
|
# check_confirmed_mails()
|
||||||
# check_appointment_link_mail("hcunlvi533@outlook.com")
|
# check_appointment_link_mail("hcunlvi533@outlook.com")
|
||||||
|
|||||||
@@ -101,8 +101,12 @@ if __name__ == '__main__':
|
|||||||
# '~/Desktop/contact_list_2024-05-21.xlsx',
|
# '~/Desktop/contact_list_2024-05-21.xlsx',
|
||||||
# '~/Desktop/15_05_to_test.xlsx']
|
# '~/Desktop/15_05_to_test.xlsx']
|
||||||
# file_list = ['~/Desktop/15_05_to_test.xlsx', '~/Desktop/16_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_2025-07-15.xlsx']
|
||||||
# file_list = ['~/Desktop/contact_list_all_studio.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']
|
# 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)
|
data_queue_name=MORNING_DATA_CACHE, stop_at_hour=19, stop_at_mins=50)
|
||||||
|
|||||||
@@ -241,8 +241,8 @@ def validate_all_links(_contact_serial_list):
|
|||||||
# else:
|
# else:
|
||||||
# _segment_number = 1
|
# _segment_number = 1
|
||||||
_thread_list = []
|
_thread_list = []
|
||||||
if len(_first_25_percent_links) >= 10:
|
if len(_first_25_percent_links) >= 20:
|
||||||
_segment_number = 10
|
_segment_number = 20
|
||||||
else:
|
else:
|
||||||
_segment_number = len(_first_25_percent_links)
|
_segment_number = len(_first_25_percent_links)
|
||||||
for i in range(0, _segment_number):
|
for i in range(0, _segment_number):
|
||||||
|
|||||||
Reference in New Issue
Block a user