Merge branch 'feature/automatic' into feature/auto_with_checkresults
This commit is contained in:
+2
-3
@@ -8,7 +8,6 @@ from playwright.sync_api import sync_playwright
|
|||||||
|
|
||||||
import params
|
import params
|
||||||
from logs.LogSender import TYPE_EVENT_CHECK_RESULTS, LOG_SUBJECT_EVENT
|
from logs.LogSender import TYPE_EVENT_CHECK_RESULTS, LOG_SUBJECT_EVENT
|
||||||
from notification.AcceptedResultPojo import get_accepted_result_from
|
|
||||||
from notification.mailer import Mailer
|
from notification.mailer import Mailer
|
||||||
from pojo.ReserveResultPojo import ReserveResultPojo
|
from pojo.ReserveResultPojo import ReserveResultPojo
|
||||||
from pojo.ResultEnum import ResultEnum
|
from pojo.ResultEnum import ResultEnum
|
||||||
@@ -26,7 +25,7 @@ mailer = Mailer()
|
|||||||
class TlsPlaywright(threading.local):
|
class TlsPlaywright(threading.local):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
self.playwright = sync_playwright().start()
|
self.playwright = sync_playwright().start()
|
||||||
print("Create playwright instance in Thread", threading.current_thread().name)
|
print("创建浏览器实例,线程: ", threading.current_thread().name)
|
||||||
|
|
||||||
|
|
||||||
class ResultChecker:
|
class ResultChecker:
|
||||||
@@ -123,7 +122,7 @@ if __name__ == '__main__':
|
|||||||
reserve_pojo = ReserveResultPojo.from_firestore_dict(appointment.to_dict())
|
reserve_pojo = ReserveResultPojo.from_firestore_dict(appointment.to_dict())
|
||||||
result_list.append(reserve_pojo)
|
result_list.append(reserve_pojo)
|
||||||
|
|
||||||
with ThreadPoolExecutor(max_workers=20) as executor:
|
with ThreadPoolExecutor(max_workers=25) as executor:
|
||||||
for reserve in result_list:
|
for reserve in result_list:
|
||||||
count = count + 1
|
count = count + 1
|
||||||
if reserve.accepted is None or ResultEnum.PENDING.value == reserve.accepted:
|
if reserve.accepted is None or ResultEnum.PENDING.value == reserve.accepted:
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ from playwright.sync_api import sync_playwright
|
|||||||
|
|
||||||
import definitions
|
import definitions
|
||||||
import params
|
import params
|
||||||
from params import PROXY_SERVER, PROXY_PASSWORD
|
|
||||||
from pojo.ModeEnum import ModeEnum
|
from pojo.ModeEnum import ModeEnum
|
||||||
from pojo.ReserveResultPojo import ReserveResultPojo, PublishType
|
from pojo.ReserveResultPojo import ReserveResultPojo, PublishType
|
||||||
from pojo.captcha_error_contact_pojo import get_captcha_error_contact_from_contact, ERROR_TYPE_CAPTCHA
|
from pojo.captcha_error_contact_pojo import get_captcha_error_contact_from_contact, ERROR_TYPE_CAPTCHA
|
||||||
@@ -125,7 +124,7 @@ class CommandorPage:
|
|||||||
def fill_fields(self):
|
def fill_fields(self):
|
||||||
if not self.is_filling_fields:
|
if not self.is_filling_fields:
|
||||||
self.is_filling_fields = True
|
self.is_filling_fields = True
|
||||||
self.logger.info("will call fill_fields for " + str(self.contact.phone))
|
self.logger.info("填充信息: " + str(self.contact.phone))
|
||||||
self._set_name(self.contact.last_name, self.contact.first_name)
|
self._set_name(self.contact.last_name, self.contact.first_name)
|
||||||
self._setPhoneCountryAndStore()
|
self._setPhoneCountryAndStore()
|
||||||
self._setPhoneNumber(self.contact.phone)
|
self._setPhoneNumber(self.contact.phone)
|
||||||
|
|||||||
Reference in New Issue
Block a user