Explorar o código

一键通话不限流

peng %!s(int64=2) %!d(string=hai) anos
pai
achega
945f517f39
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      Controller/DetectControllerV2.py

+ 3 - 2
Controller/DetectControllerV2.py

@@ -69,6 +69,7 @@ class NotificationV2View(View):
         try:
             is_st = int(is_st)
             region = int(region)
+            event_type = int(event_type)
             if not uid:
                 uid = DevicePushService.decode_uid(etk, uidToken)  # 解密uid
             if len(uid) != 20 and len(uid) != 14:
@@ -86,7 +87,7 @@ class NotificationV2View(View):
             cache_app_push = redisObj.get_data(key=push_interval)  # 获取APP推送消息时间间隔缓存数据
             logger.info('消息推送- 限流key: {}, 推送间隔key: {}'.
                         format(cache_req_limiting, cache_app_push))
-            if event_type != '606':
+            if event_type != 606:
                 if cache_req_limiting:  # 限流存在则直接返回
                     return JsonResponse(status=200, data={'code': 0, 'msg': 'Push again in one minute'})
             redisObj.set_data(key=req_limiting, val=1, expire=60)  # 当缓存不存在限流数据 重新设置一分钟请求一次
@@ -102,7 +103,7 @@ class NotificationV2View(View):
             nickname = uid if not nickname else nickname
             # APP消息提醒推送间隔
             detect_interval = uid_set_push_list[0]['uid_set__detect_interval']
-            if event_type != '606':
+            if event_type != 606:
                 if not cache_app_push:
                     # 缓存APP提醒推送间隔 默认1分钟提醒一次
                     DevicePushService.cache_push_detect_interval(redisObj, push_interval, detect_interval,