Explorar el Código

feature:
notify push limit by uid (not by uid_channel)

chenjunkai hace 5 años
padre
commit
1cec75e40d
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      Controller/DetectController.py

+ 4 - 2
Controller/DetectController.py

@@ -405,7 +405,8 @@ class NotificationView(View):
         utko = UidTokenObject(uidToken)
         uid = utko.UID
         redisObj = RedisObject(db=6)
-        pkey = '{uid}_{channel}_ptl'.format(uid=uid, channel=channel)
+        # pkey = '{uid}_{channel}_ptl'.format(uid=uid, channel=channel)
+        pkey = '{uid}_ptl'.format(uid=uid)
         if redisObj.get_data(key=pkey):
             res_data = {'code': 0, 'msg': 'success,!'}
             return JsonResponse(status=200, data=res_data)
@@ -646,7 +647,8 @@ class PushNotificationView(View):
         uid = eto.uid
         if len(uid) == 20:
             redisObj = RedisObject(db=6)
-            pkey = '{uid}_{channel}_ptl'.format(uid=uid, channel=channel)
+            # pkey = '{uid}_{channel}_ptl'.format(uid=uid, channel=channel)
+            pkey = '{uid}_ptl'.format(uid=uid)
             # 推送时间限制
             if redisObj.get_data(key=pkey):
                 res_data = {'code': 0, 'msg': 'success,!'}