|
@@ -152,8 +152,8 @@ class NotificationView(View):
|
|
|
detect_interval = 60
|
|
|
redisObj.set_data(key=dkey, val=1, expire=detect_interval)
|
|
|
|
|
|
- # if is_st == 1 or is_st == 3: # 使用aws s3
|
|
|
- aws_s3_client = s3_client(region=region)
|
|
|
+ if is_st == 1 or is_st == 3: # 使用aws s3
|
|
|
+ aws_s3_client = s3_client(region=region)
|
|
|
kwag_args = {
|
|
|
'uid': uid,
|
|
|
'channel': channel,
|
|
@@ -208,20 +208,6 @@ class NotificationView(View):
|
|
|
uid=uid,
|
|
|
eventType=event_type))
|
|
|
else:
|
|
|
- # eq_list.append(Equipment_Info(
|
|
|
- # userID_id=userID_id,
|
|
|
- # eventTime=n_time,
|
|
|
- # eventType=event_type,
|
|
|
- # devUid=uid,
|
|
|
- # devNickName=nickname,
|
|
|
- # Channel=channel,
|
|
|
- # alarm='Motion \tChannel:{channel}'.format(channel=channel),
|
|
|
- # is_st=is_st,
|
|
|
- # receiveTime=n_time,
|
|
|
- # addTime=now_time,
|
|
|
- # storage_location=2,
|
|
|
- # borderCoords='',
|
|
|
- # ))
|
|
|
# start 根据设备侦测时间为准进行分表存储数据
|
|
|
logger.info('分表存数据start------')
|
|
|
new_device_info_list.append(EquipmentInfoService.get_equipment_info_obj(
|
|
@@ -244,10 +230,10 @@ class NotificationView(View):
|
|
|
try:
|
|
|
# 推送消息
|
|
|
if not have_dkey:
|
|
|
- logger.info('准备推送:{}, {}'.format(uid, request_dict))
|
|
|
+ # logger.info('准备推送:{}, {}'.format(uid, request_dict))
|
|
|
# if (is_st == 1 or is_st == 3) and (push_type == 0 or push_type == 1):
|
|
|
- push_thread = threading.Thread(target=self.push_thread_test, args=(push_type, aws_s3_client, uid, appBundleId, token_val, event_type, n_time, msg_title, msg_text, channel))
|
|
|
- push_thread.start()
|
|
|
+ # push_thread = threading.Thread(target=self.push_thread_test, args=(push_type, aws_s3_client, uid, appBundleId, token_val, event_type, n_time, msg_title, msg_text, channel))
|
|
|
+ # push_thread.start()
|
|
|
if push_type == 0: # ios apns
|
|
|
do_apns_code = self.do_apns(**kwag_args)
|
|
|
logger.info('进入do_apns,uid={}'.format(uid))
|
|
@@ -311,16 +297,6 @@ class NotificationView(View):
|
|
|
del up['uid_set__nickname']
|
|
|
del up['uid_set__detect_interval']
|
|
|
del up['uid_set__detect_group']
|
|
|
-
|
|
|
- # try:
|
|
|
- # # 推送消息
|
|
|
- # if not have_dkey:
|
|
|
- # push_thread = threading.Thread(target=self.push_thread, args=(push_type, aws_s3_client, region, thumbspng, uid, appBundleId, token_val, event_type, n_time, msg_title, msg_text))
|
|
|
- # push_thread.start()
|
|
|
- # except Exception as e:
|
|
|
- # logger.info('---推送图片异常---{}'.format(e))
|
|
|
- # pass
|
|
|
-
|
|
|
res_data = {'code': 0, 'img_push': response_url, 'msg': 'success'}
|
|
|
return JsonResponse(status=200, data=res_data)
|
|
|
|