瀏覽代碼

APP消息推送增加打印

zhangdongming 2 年之前
父節點
當前提交
c5a645b3e0
共有 2 個文件被更改,包括 5 次插入3 次删除
  1. 2 1
      Controller/DetectController.py
  2. 3 2
      Controller/DetectControllerV2.py

+ 2 - 1
Controller/DetectController.py

@@ -133,7 +133,7 @@ class NotificationView(View):
                             detect_interval = 60
                         redisObj.set_data(key=dkey, val=1, expire=detect_interval)
                 redisObj.set_data(key=pkey, val=1, expire=60)
-
+        logger.info('APP消息推送V1接口,是否进行APP推送:{},1为不推送,间隔:{}'.format(detect_med_type, detect_interval))
         # 旧模式并且没有pkey,重新创建一个
         if not detect_group and not have_pkey:
             redisObj.set_data(key=pkey, val=1, expire=60)
@@ -212,6 +212,7 @@ class NotificationView(View):
 
             # 推送
             if detect_med_type == 2 or detect_med_type == 0:
+                logger.info('准备推送{}'.format(detect_med_type))
                 try:
                     if push_type == 0:  # ios apns
                         do_apns_code = self.do_apns(**kwag_args)

+ 3 - 2
Controller/DetectControllerV2.py

@@ -113,7 +113,7 @@ class NotificationV2View(View):
 
             if not nickname:
                 nickname = uid
-
+            logger.info('APP消息推送V2接口,是否进行APP推送:{},1为不推送,null为推送'.format(have_dkey))
             if not have_dkey:
                 # 设置推送消息的时间间隔
                 new_detect_interval = redis_list[0]['uid_set__new_detect_interval']
@@ -125,6 +125,7 @@ class NotificationV2View(View):
                     detect_group_list = detect_group.split(',')
                     if event_type in detect_group_list:
                         redisObj.set_data(key=dkey, val=1, expire=detect_interval)
+                logger.info('APP消息推送间隔:{}s'.format(detect_interval))
 
             if is_st == 1 or is_st == 3:  # 使用aws s3
                 aws_s3_client = s3_client(region=region)
@@ -204,7 +205,7 @@ class NotificationV2View(View):
                 try:
                     # 推送消息
                     if not have_dkey:
-                        logger.info('准备推送:{}, {}'.format(uid, request_dict))
+                        logger.info('APP准备推送:{}, {}'.format(uid, request_dict))
                         if (is_st == 1 or is_st == 3) and (push_type == 0 or push_type == 1):  # 推送显示图片
                             if is_st == 1:
                                 key = '{}/{}/{}.jpeg'.format(uid, channel, n_time)