Explorar o código

去掉时间限制注释

locky hai 1 ano
pai
achega
72d2d2f018
Modificáronse 2 ficheiros con 4 adicións e 4 borrados
  1. 1 1
      Controller/DetectController.py
  2. 3 3
      Controller/DetectControllerV2.py

+ 1 - 1
Controller/DetectController.py

@@ -79,7 +79,7 @@ class NotificationView(View):
                 # 从数据库查询出来
                 uid_push_qs = DevicePushService.query_uid_push(uid, event_type)
                 if not uid_push_qs.exists():
-                    V1_PUSH_LOGGER.info('消息推送-uid_push 数据不存在')
+                    V1_PUSH_LOGGER.info('{}uid_push数据不存在'.format(uid))
                     return JsonResponse(status=200, data={'code': 176, 'msg': 'no uid_push data'})
                 # 修改redis数据,并设置过期时间为10分钟
                 uid_push_list = DevicePushService.qs_to_list(uid_push_qs)

+ 3 - 3
Controller/DetectControllerV2.py

@@ -76,9 +76,9 @@ class NotificationV2View(View):
             req_limiting = '{}_{}_{}_ptl'.format(uid, channel, event_type)
             cache_req_limiting = redis_obj.get_data(key=req_limiting)  # 获取请求限流缓存数据
             cache_app_push = redis_obj.get_data(key=push_interval)  # 获取APP推送消息时间间隔缓存数据
-            # if event_type not in [606, 607]:
-            #     if cache_req_limiting:  # 限流存在则直接返回
-            #         return JsonResponse(status=200, data={'code': 0, 'msg': 'Push again in one minute'})
+            if event_type not in [606, 607]:
+                if cache_req_limiting:  # 限流存在则直接返回
+                    return JsonResponse(status=200, data={'code': 0, 'msg': 'Push again in one minute'})
             redis_obj.set_data(key=req_limiting, val=1, expire=60)  # 当缓存不存在限流数据 重新设置一分钟请求一次
 
             # 查询uid_push和uid_set数据