add method to extract contact list with serial

This commit is contained in:
2024-12-13 16:46:50 +01:00
parent 15286494d1
commit a6c2af03e8
2 changed files with 18 additions and 2 deletions
+3 -1
View File
@@ -256,6 +256,7 @@ def read_mails():
# get ip_country info
_refreshed_successful_items = MONGO_STORE_MANAGER.get_all_successful_items_for_day()
_all_contact_list = MONGO_STORE_MANAGER.get_all_contacts_to_book()
contact_serial_map_list = MONGO_STORE_MANAGER.get_all_contact_serial_list()
with ThreadPoolExecutor(max_workers=10) as executor:
for mail in mails_messages:
match = re.search(VALIDATION_URL_REGEX, mail.body)
@@ -263,7 +264,8 @@ def read_mails():
url = match.group(0)
_item, is_need_to = need_to_valid_url(url, _refreshed_successful_items)
if is_need_to:
MONGO_STORE_MANAGER.save_links_to_validate(url, mail.to_address, _all_contact_list, _item)
MONGO_STORE_MANAGER.save_links_to_validate(url, mail.to_address, _all_contact_list, _item,
contact_serial_map_list)
# url_validator = LinkValidator(url)
print("need to validate url: " + url)
# executor.submit(url_validator.start_page, params.get_proxy(ProxyType.OXYLABS), False)