save errors in local db

This commit is contained in:
Lei PAN
2022-06-02 17:59:12 +02:00
parent f3694ef8ee
commit d13a96b984
5 changed files with 100 additions and 18 deletions
+5
View File
@@ -8,10 +8,12 @@ from typing import Union
from playwright.sync_api import sync_playwright
import definitions
import params
from params import PROXY_SERVER, PROXY_PASSWORD
from pojo.ModeEnum import ModeEnum
from pojo.ReserveResultPojo import ReserveResultPojo, PublishType
from pojo.captcha_error_contact_pojo import get_captcha_error_contact_from_contact, ERROR_TYPE_CAPTCHA
from pojo.contact_pojo import ContactPojo
from workers.SolveCaptch import SolveCaptcha
@@ -256,6 +258,9 @@ class CommandorPage:
# this email has been already used
self.is_captcha_in_error = True
if not self.is_finished:
# save the error to database with contact info
definitions.local_db_manager.insert_or_update(
get_captcha_error_contact_from_contact(self.contact, ERROR_TYPE_CAPTCHA))
params.oracle_log_sender.send_captcha_error(self.contact)
self.is_finished = True
# no need to retry captcha, if retry ,will generate DOUBLE_REQUEST_ERROR_MESSAGE