|
@@ -44,6 +44,7 @@ class NotificationView(View):
|
|
|
is_st = request_dict.get('is_st', 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:
|
|
|
uid = DevicePushService.decode_uid(etk, uidToken) # 解密uid
|
|
|
if len(uid) != 20 and len(uid) != 14:
|
|
@@ -58,7 +59,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) # 推送类型限制
|
|
@@ -213,6 +213,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]
|