|
@@ -39,6 +39,7 @@ from django.db import close_old_connections
|
|
|
|
|
|
LOGGING = logging.getLogger('info')
|
|
LOGGING = logging.getLogger('info')
|
|
TIME_LOGGER = logging.getLogger('time')
|
|
TIME_LOGGER = logging.getLogger('time')
|
|
|
|
+ERROR_INFO_LOGGER = logging.getLogger('error_info')
|
|
|
|
|
|
|
|
|
|
class DevicePushService:
|
|
class DevicePushService:
|
|
@@ -218,8 +219,9 @@ class DevicePushService:
|
|
)
|
|
)
|
|
push_thread.start()
|
|
push_thread.start()
|
|
except Exception as e:
|
|
except Exception as e:
|
|
- TIME_LOGGER.info('APP通知V2推送接口异常uid:{},error_line:{},error_msg:{}'
|
|
|
|
- .format(params['uid'], e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
+ ERROR_INFO_LOGGER.info(
|
|
|
|
+ '推送消息线程异常,uid:{},error_line:{},error_msg:{}'
|
|
|
|
+ .format(params['uid'], e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
def save_msg_push(cls, **params):
|
|
def save_msg_push(cls, **params):
|
|
@@ -316,7 +318,9 @@ class DevicePushService:
|
|
equipment_info_model.objects.bulk_create(equipment_info_list)
|
|
equipment_info_model.objects.bulk_create(equipment_info_list)
|
|
return True
|
|
return True
|
|
except Exception as e:
|
|
except Exception as e:
|
|
- LOGGING.info('推送消息或存表异常uid:{}, error_line:{}, error_msg:{}'.format(uid, e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
+ ERROR_INFO_LOGGER.info(
|
|
|
|
+ '保存推送数据和推送消息线程异常,uid:{}, error_line:{}, error_msg:{}'.
|
|
|
|
+ format(uid, e.__traceback__.tb_lineno, repr(e)))
|
|
return False
|
|
return False
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -452,7 +456,8 @@ class DevicePushService:
|
|
content=push_kwargs, push_result=push_result, push_type=push_type)
|
|
content=push_kwargs, push_result=push_result, push_type=push_type)
|
|
return push_result
|
|
return push_result
|
|
except Exception as e:
|
|
except Exception as e:
|
|
- LOGGING.error('发送推送异常,error_line:{},error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
+ ERROR_INFO_LOGGER.info(
|
|
|
|
+ '发送推送线程异常,error_line:{},error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
return False
|
|
return False
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|