|
@@ -58,7 +58,7 @@ class NotificationV2View(View):
|
|
|
is_st = int(is_st)
|
|
|
region = int(region)
|
|
|
event_type = int(event_type)
|
|
|
-
|
|
|
+ redis_obj = RedisObject()
|
|
|
try:
|
|
|
uid = DevicePushService.decode_uid(etk, uidToken)
|
|
|
if len(uid) != 20 and len(uid) != 14:
|
|
@@ -72,7 +72,6 @@ class NotificationV2View(View):
|
|
|
else:
|
|
|
push_interval = '{uid}_{channel}_flag'.format(uid=uid, channel=channel)
|
|
|
|
|
|
- redis_obj = RedisObject()
|
|
|
req_limiting = '{uid}_{channel}_{event_type}_ptl'.format(uid=uid, channel=channel, event_type=event_type)
|
|
|
cache_req_limiting = redis_obj.get_data(key=req_limiting) # 获取请求限流缓存数据
|
|
|
cache_app_push = redis_obj.get_data(key=push_interval) # 获取APP推送消息时间间隔缓存数据
|
|
@@ -143,3 +142,5 @@ class NotificationV2View(View):
|
|
|
'errMsg': repr(e),
|
|
|
}
|
|
|
return JsonResponse(status=200, data=json.dumps(data), safe=False)
|
|
|
+ finally:
|
|
|
+ redis_obj.CONN.close()
|