From 26e2956bd85709c46674a9bd283595ea5acb909a Mon Sep 17 00:00:00 2001 From: Lei PAN Date: Tue, 25 Jun 2024 18:39:12 +0200 Subject: [PATCH] reduce wait time and support outlook.com mails --- mail/mail_constants.py | 3 ++- queue_message/appointmentrequestsender.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mail/mail_constants.py b/mail/mail_constants.py index 41d820b..139898d 100755 --- a/mail/mail_constants.py +++ b/mail/mail_constants.py @@ -32,6 +32,7 @@ DOMAIN_CHILD_PIZZA = "child.pizza" DOMAIN_GENOCIDE_FUN = "genocide.fun" DOMAIN_DMC_CHAT = "dmc.chat" DOMAIN_WEB_DE = "web.de" +DOMAIN_OUTLOOK_COM = "outlook.com" AOL_IMAP_SERVER = "imap.aol.com" IMAP_SERVER_163 = "imap.163.com" @@ -85,7 +86,7 @@ def create_imap(login: str): elif DOMAIN_SINA in login: # imap = imaplib.IMAP4_SSL(IMAP_SERVER_SINA) imap = IMAPClient(IMAP_SERVER_SINA, use_uid=True) - elif DOMAIN_HOTMAIL in login: + elif DOMAIN_HOTMAIL in login or DOMAIN_OUTLOOK_COM in login: imap = imaplib.IMAP4_SSL(HOTMAIL_IMAP_SERVER) elif DOMAIN_RAMBLER_RU in login: imap = imaplib.IMAP4_SSL(RAMBLER_IMAP_SERVER) diff --git a/queue_message/appointmentrequestsender.py b/queue_message/appointmentrequestsender.py index 5d62a28..9b8290f 100644 --- a/queue_message/appointmentrequestsender.py +++ b/queue_message/appointmentrequestsender.py @@ -204,7 +204,7 @@ class AppointmentRequestSender(threading.Thread): else: self.retrieve_invalidate_urls() self.logger.info("empty list") - time.sleep(60) + time.sleep(20) self.logger.info("will basic_reject method.delivery_tag: " + str(method.delivery_tag)) ch.basic_reject(delivery_tag=method.delivery_tag, requeue=True) else: