|
@@ -45,6 +45,7 @@ class NotificationView(View):
|
|
|
uid = request_dict.get('uid', None)
|
|
|
if not all([channel, n_time]):
|
|
|
return JsonResponse(status=200, data={'code': 444, 'msg': 'error channel or n_time'})
|
|
|
+ redisObj = RedisObject(db=6)
|
|
|
try:
|
|
|
if not uid:
|
|
|
uid = DevicePushService.decode_uid(etk, uidToken) # 解密uid
|
|
@@ -60,7 +61,6 @@ class NotificationView(View):
|
|
|
else:
|
|
|
dkey = '{uid}_{channel}_flag'.format(uid=uid, channel=channel)
|
|
|
|
|
|
- redisObj = RedisObject(db=6)
|
|
|
have_ykey = redisObj.get_data(key=ykey) # uid_set 数据库缓存
|
|
|
have_pkey = redisObj.get_data(key=pkey) # 一分钟限制key
|
|
|
have_dkey = redisObj.get_data(key=dkey) # 推送类型限制
|
|
@@ -214,6 +214,8 @@ class NotificationView(View):
|
|
|
'errMsg': repr(e),
|
|
|
}
|
|
|
return JsonResponse(status=200, data=json.dumps(data), safe=False)
|
|
|
+ finally:
|
|
|
+ redisObj.CONN.close()
|
|
|
|
|
|
def is_sys_msg(self, event_type):
|
|
|
event_type_list = [702, 703, 704]
|