|
@@ -76,16 +76,15 @@ class NotificationV2View(View):
|
|
|
ykey = '{uid}_redis_qs'.format(uid=uid)
|
|
|
is_sys_msg = self.is_sys_msg(int(event_type))
|
|
|
if is_sys_msg:
|
|
|
- dkey = 'push_{uid}_{channel}_{event_type}_flag'.format(uid=uid, channel=channel, event_type=event_type)
|
|
|
+ dkey = '{uid}_{channel}_{event_type}_flag'.format(uid=uid, channel=channel, event_type=event_type)
|
|
|
else:
|
|
|
- dkey = 'push_{uid}_{channel}_flag'.format(uid=uid, channel=channel)
|
|
|
+ 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) # 推送消息时间间隔
|
|
|
logger.info('ykey:{}, pkey: {}, dkey: {}'.format(have_ykey, have_pkey, have_dkey))
|
|
|
- logger.info('ykey:{}, pkey: {}, dkey: {}'.format(ykey, pkey, dkey))
|
|
|
# 一分钟内不推送
|
|
|
if have_pkey:
|
|
|
return JsonResponse(status=200, data={'code': 0, 'msg': 'Push again in one minute'})
|
|
@@ -109,11 +108,8 @@ class NotificationV2View(View):
|
|
|
|
|
|
nickname = redis_list[0]['uid_set__nickname']
|
|
|
detect_interval = redis_list[0]['uid_set__detect_interval']
|
|
|
- detect_group = redis_list[0]['uid_set__detect_group']
|
|
|
-
|
|
|
if not nickname:
|
|
|
nickname = uid
|
|
|
- logger.info('APP消息推送V2接口,是否进行APP推送:{},1为不推送,null为推送'.format(have_dkey))
|
|
|
if not have_dkey:
|
|
|
# 设置推送消息的时间间隔
|
|
|
new_detect_interval = redis_list[0]['uid_set__new_detect_interval']
|