|
@@ -69,6 +69,7 @@ class NotificationV2View(View):
|
|
if time_token:
|
|
if time_token:
|
|
if not CommonService.check_time_stamp_token(time_token, n_time):
|
|
if not CommonService.check_time_stamp_token(time_token, n_time):
|
|
return JsonResponse(status=200, data={'code': 13, 'msg': 'Timestamp token verification failed'})
|
|
return JsonResponse(status=200, data={'code': 13, 'msg': 'Timestamp token verification failed'})
|
|
|
|
+ redisObj = RedisObject(db=6)
|
|
try:
|
|
try:
|
|
is_st = int(is_st)
|
|
is_st = int(is_st)
|
|
region = int(region)
|
|
region = int(region)
|
|
@@ -85,7 +86,7 @@ class NotificationV2View(View):
|
|
.format(uid=uid, channel=channel, event_type=event_type)
|
|
.format(uid=uid, channel=channel, event_type=event_type)
|
|
else:
|
|
else:
|
|
push_interval = '{uid}_{channel}_flag'.format(uid=uid, channel=channel)
|
|
push_interval = '{uid}_{channel}_flag'.format(uid=uid, channel=channel)
|
|
- redisObj = RedisObject(db=6)
|
|
|
|
|
|
+
|
|
cache_req_limiting = redisObj.get_data(key=req_limiting) # 获取请求限流缓存数据
|
|
cache_req_limiting = redisObj.get_data(key=req_limiting) # 获取请求限流缓存数据
|
|
cache_app_push = redisObj.get_data(key=push_interval) # 获取APP推送消息时间间隔缓存数据
|
|
cache_app_push = redisObj.get_data(key=push_interval) # 获取APP推送消息时间间隔缓存数据
|
|
logger.info('消息推送- 限流key: {}, 推送间隔key: {}'.
|
|
logger.info('消息推送- 限流key: {}, 推送间隔key: {}'.
|
|
@@ -149,6 +150,8 @@ class NotificationV2View(View):
|
|
'errMsg': repr(e),
|
|
'errMsg': repr(e),
|
|
}
|
|
}
|
|
return JsonResponse(status=200, data=json.dumps(data), safe=False)
|
|
return JsonResponse(status=200, data=json.dumps(data), safe=False)
|
|
|
|
+ finally:
|
|
|
|
+ redisObj.CONN.close()
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
def get_combo_msg_type(cls, ai_type, event_type):
|
|
def get_combo_msg_type(cls, ai_type, event_type):
|