change interval to check emails

This commit is contained in:
2022-10-07 09:21:02 +02:00
parent 78fcf10217
commit 8b59746ab8
3 changed files with 7 additions and 6 deletions
+4 -3
View File
@@ -145,7 +145,7 @@ def need_to_valid_url(url: str, successful_items) -> bool:
def need_to_check_email(mail: str, successful_items) -> bool:
return True
# return True
print("successful_items size is " + str(len(successful_items)))
for item in successful_items:
if mail in item.email:
@@ -156,6 +156,7 @@ def need_to_check_email(mail: str, successful_items) -> bool:
# if url-validated is none, need to check email
return True
# if the email has not been booked, we needn't read mails.
# return True
if mail in REDIRECTION_MAILS:
return True
else:
@@ -182,7 +183,7 @@ def read_mails():
mail_reader = MailReader(mail.mail, mail.password)
executor.submit(mail_reader.read_emails, mails_messages)
with ThreadPoolExecutor(max_workers=8) as executor:
with ThreadPoolExecutor(max_workers=10) as executor:
for mail in mails_messages:
match = re.search(VALIDATION_URL_REGEX, mail.body)
if match:
@@ -190,7 +191,7 @@ def read_mails():
if need_to_valid_url(url, successful_items):
url_validator = LinkValidator(url)
print("need to validate url: " + url)
executor.submit(url_validator.start_page, params.get_proxy(ProxyType.RESIDENTIAL), False)
executor.submit(url_validator.start_page, params.get_proxy(ProxyType.RESIDENTIAL), True)
else:
print("do not need to click url --> {}".format(mail.mail_address))