no need to use executor
This commit is contained in:
+12
-12
@@ -191,18 +191,18 @@ def read_mails():
|
|||||||
mail_reader = MailReader(mail.mail, mail.password)
|
mail_reader = MailReader(mail.mail, mail.password)
|
||||||
executor.submit(mail_reader.read_emails, mails_messages)
|
executor.submit(mail_reader.read_emails, mails_messages)
|
||||||
|
|
||||||
with ThreadPoolExecutor(max_workers=10) as executor:
|
# with ThreadPoolExecutor(max_workers=10) as executor:
|
||||||
for mail in mails_messages:
|
for mail in mails_messages:
|
||||||
match = re.search(VALIDATION_URL_REGEX, mail.body)
|
match = re.search(VALIDATION_URL_REGEX, mail.body)
|
||||||
if match:
|
if match:
|
||||||
url = match.group(0)
|
url = match.group(0)
|
||||||
if need_to_valid_url(url, successful_items):
|
if need_to_valid_url(url, successful_items):
|
||||||
MONGO_STORE_MANAGER.save_links_to_validate(url)
|
MONGO_STORE_MANAGER.save_links_to_validate(url)
|
||||||
# url_validator = LinkValidator(url)
|
# url_validator = LinkValidator(url)
|
||||||
# print("need to validate url: " + url)
|
# print("need to validate url: " + url)
|
||||||
# executor.submit(url_validator.start_page, params.get_proxy(ProxyType.OXYLABS), False)
|
# executor.submit(url_validator.start_page, params.get_proxy(ProxyType.OXYLABS), False)
|
||||||
else:
|
else:
|
||||||
print("do not need to click url --> {}".format(mail.mail_address))
|
print("do not need to click url --> {}".format(mail.mail_address))
|
||||||
|
|
||||||
|
|
||||||
# check whether the url has already been clicked
|
# check whether the url has already been clicked
|
||||||
|
|||||||
Reference in New Issue
Block a user