|
@@ -35,6 +35,7 @@ from Service.CommonService import CommonService
|
|
from Service.EquipmentInfoService import EquipmentInfoService, EQUIPMENT_INFO_DICT
|
|
from Service.EquipmentInfoService import EquipmentInfoService, EQUIPMENT_INFO_DICT
|
|
from Service.HuaweiPushService.HuaweiPushService import HuaweiPushObject
|
|
from Service.HuaweiPushService.HuaweiPushService import HuaweiPushObject
|
|
from Service.PushService import PushObject
|
|
from Service.PushService import PushObject
|
|
|
|
+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')
|
|
@@ -280,7 +281,7 @@ class DevicePushService:
|
|
redis_obj.rpush(equipment_info_key, equipment_info_value)
|
|
redis_obj.rpush(equipment_info_key, equipment_info_value)
|
|
LOGGING.info('***保存推送消息uid:{},time:{},user_id:{}'.format(uid, params['n_time'], user_id))
|
|
LOGGING.info('***保存推送消息uid:{},time:{},user_id:{}'.format(uid, params['n_time'], user_id))
|
|
saved_user_id_list.append(user_id)
|
|
saved_user_id_list.append(user_id)
|
|
-
|
|
|
|
|
|
+ close_old_connections()
|
|
# 写入系统消息
|
|
# 写入系统消息
|
|
if sys_msg_list:
|
|
if sys_msg_list:
|
|
SysMsgModel.objects.bulk_create(sys_msg_list)
|
|
SysMsgModel.objects.bulk_create(sys_msg_list)
|
|
@@ -315,7 +316,7 @@ 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)))
|
|
|
|
|
|
+ LOGGING.info('推送消息或存表异常uid:{}, error_line:{}, error_msg:{}'.format(uid, e.__traceback__.tb_lineno, repr(e)))
|
|
return False
|
|
return False
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
@@ -825,7 +826,8 @@ class DevicePushService:
|
|
params['Key'] = key_name
|
|
params['Key'] = key_name
|
|
if kwargs['region'] == 1:
|
|
if kwargs['region'] == 1:
|
|
# OCI
|
|
# OCI
|
|
- img_url = DevicePushService.create_oci_req_url(storage_location, params['Bucket'], key_name, oci_client)
|
|
|
|
|
|
+ img_url = DevicePushService.create_oci_req_url(storage_location, params['Bucket'], key_name,
|
|
|
|
+ oci_client)
|
|
img_url_list.append(img_url)
|
|
img_url_list.append(img_url)
|
|
else:
|
|
else:
|
|
# 华为云
|
|
# 华为云
|