diff --git a/commandor_page.py b/commandor_page.py index 6843497..45f7573 100644 --- a/commandor_page.py +++ b/commandor_page.py @@ -7,7 +7,7 @@ import time from playwright.sync_api import sync_playwright import params -from params import PROXY_SERVER, PROXY_USERNAME, PROXY_PASSWORD +from params import PROXY_SERVER, PROXY_PASSWORD from pojo.ReserveResultPojo import ReserveResultPojo, PublishType from pojo.contact_pojo import ContactPojo from utils.excel_reader import ExcelHelper diff --git a/logs/LogSender.py b/logs/LogSender.py index 7b3b1bd..76ef3da 100644 --- a/logs/LogSender.py +++ b/logs/LogSender.py @@ -25,6 +25,7 @@ LOG_ERROR = "ERROR" LOG_TYPE_INFO = "INFO" LOG_APPOINTMENT_ERROR = "APPOINTMENT_ERROR" LOG_APPOINTMENT_TIMEOUT = "TIMEOUT" +LOG_APPOINTMENT_CONTACT_NOT_FOUND = "CONTACT_NOT_FOUND" LOG_APPOINTMENT_SUCCESS = "SUCCESS" @@ -65,10 +66,13 @@ class LogSender: msg = "phone:{}, sms:{}".format(phone, sms_text) self.send_log(msg=msg, subject=LOG_SUBJECT_SMS, type=TYPE_SMS_RECEIVED) - def send_timeout_log(self,serial_modem: SerialModem): + def send_timeout_log(self, serial_modem: SerialModem): msg = "phone:{}, ccid:{}".format(serial_modem.phone_number, serial_modem.ccid) self.send_log(msg, type=LOG_APPOINTMENT_TIMEOUT) + def send_contact_not_found(self, msg: str): + self.send_log(msg, subject=SUBJECT_SIM_INFO, type=LOG_APPOINTMENT_CONTACT_NOT_FOUND) + if __name__ == '__main__': init_logger() diff --git a/main.py b/main.py index 80cb54e..eba90a9 100644 --- a/main.py +++ b/main.py @@ -190,6 +190,8 @@ def start_book(): modem.contact = contact[0] else: logger.info("contact not found for this ccid") + error_msg = "slot({}),sim({})".format(i, current_sim_position) + oracle_log_sender.send_contact_not_found(error_msg) modem.modem.close() continue if modem.contact: