add logs for contact not found error

This commit is contained in:
2022-03-24 10:26:44 +01:00
parent cd71577e71
commit d0d3d59f27
3 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -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
+4
View File
@@ -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"
@@ -69,6 +70,9 @@ class LogSender:
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()
+2
View File
@@ -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: