add logs for contact not found error
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ import time
|
|||||||
from playwright.sync_api import sync_playwright
|
from playwright.sync_api import sync_playwright
|
||||||
|
|
||||||
import params
|
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.ReserveResultPojo import ReserveResultPojo, PublishType
|
||||||
from pojo.contact_pojo import ContactPojo
|
from pojo.contact_pojo import ContactPojo
|
||||||
from utils.excel_reader import ExcelHelper
|
from utils.excel_reader import ExcelHelper
|
||||||
|
|||||||
+5
-1
@@ -25,6 +25,7 @@ LOG_ERROR = "ERROR"
|
|||||||
LOG_TYPE_INFO = "INFO"
|
LOG_TYPE_INFO = "INFO"
|
||||||
LOG_APPOINTMENT_ERROR = "APPOINTMENT_ERROR"
|
LOG_APPOINTMENT_ERROR = "APPOINTMENT_ERROR"
|
||||||
LOG_APPOINTMENT_TIMEOUT = "TIMEOUT"
|
LOG_APPOINTMENT_TIMEOUT = "TIMEOUT"
|
||||||
|
LOG_APPOINTMENT_CONTACT_NOT_FOUND = "CONTACT_NOT_FOUND"
|
||||||
LOG_APPOINTMENT_SUCCESS = "SUCCESS"
|
LOG_APPOINTMENT_SUCCESS = "SUCCESS"
|
||||||
|
|
||||||
|
|
||||||
@@ -65,10 +66,13 @@ class LogSender:
|
|||||||
msg = "phone:{}, sms:{}".format(phone, sms_text)
|
msg = "phone:{}, sms:{}".format(phone, sms_text)
|
||||||
self.send_log(msg=msg, subject=LOG_SUBJECT_SMS, type=TYPE_SMS_RECEIVED)
|
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)
|
msg = "phone:{}, ccid:{}".format(serial_modem.phone_number, serial_modem.ccid)
|
||||||
self.send_log(msg, type=LOG_APPOINTMENT_TIMEOUT)
|
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__':
|
if __name__ == '__main__':
|
||||||
init_logger()
|
init_logger()
|
||||||
|
|||||||
@@ -190,6 +190,8 @@ def start_book():
|
|||||||
modem.contact = contact[0]
|
modem.contact = contact[0]
|
||||||
else:
|
else:
|
||||||
logger.info("contact not found for this ccid")
|
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()
|
modem.modem.close()
|
||||||
continue
|
continue
|
||||||
if modem.contact:
|
if modem.contact:
|
||||||
|
|||||||
Reference in New Issue
Block a user