|
@@ -76,9 +76,7 @@ class NotificationView(View):
|
|
have_ykey = redisObj.get_data(key=ykey) # uid_set 数据库缓存
|
|
have_ykey = redisObj.get_data(key=ykey) # uid_set 数据库缓存
|
|
have_pkey = redisObj.get_data(key=pkey) # 一分钟限制key
|
|
have_pkey = redisObj.get_data(key=pkey) # 一分钟限制key
|
|
have_dkey = redisObj.get_data(key=dkey) # 推送类型限制
|
|
have_dkey = redisObj.get_data(key=dkey) # 推送类型限制
|
|
- # 打印have_ykey
|
|
|
|
- return JsonResponse(status=200,
|
|
|
|
- data={'pkey': 0, 'have_ykey': have_ykey, 'have_pkey': have_pkey, 'have_dkey': have_dkey})
|
|
|
|
|
|
+
|
|
# 一分钟外,推送开启状态
|
|
# 一分钟外,推送开启状态
|
|
detect_med_type = 0 # 0推送旧机制 1存库不推送,2推送存库
|
|
detect_med_type = 0 # 0推送旧机制 1存库不推送,2推送存库
|
|
if have_pkey:
|
|
if have_pkey:
|
|
@@ -107,8 +105,9 @@ class NotificationView(View):
|
|
|
|
|
|
if not redis_list:
|
|
if not redis_list:
|
|
print("没有redi_list")
|
|
print("没有redi_list")
|
|
- res_data = {'code': 0, 'msg': 'success!'}
|
|
|
|
|
|
+ res_data = {'code': 0, 'msg': 'no redi_list success!'}
|
|
return JsonResponse(status=200, data=res_data)
|
|
return JsonResponse(status=200, data=res_data)
|
|
|
|
+
|
|
is_sys_msg = self.is_sys_msg(int(event_type))
|
|
is_sys_msg = self.is_sys_msg(int(event_type))
|
|
nickname = redis_list[0]['uid_set__nickname']
|
|
nickname = redis_list[0]['uid_set__nickname']
|
|
detect_interval = redis_list[0]['uid_set__detect_interval']
|
|
detect_interval = redis_list[0]['uid_set__detect_interval']
|
|
@@ -132,6 +131,10 @@ class NotificationView(View):
|
|
redisObj.set_data(key=dkey, val=1, expire=detect_interval)
|
|
redisObj.set_data(key=dkey, val=1, expire=detect_interval)
|
|
redisObj.set_data(key=pkey, val=1, expire=60)
|
|
redisObj.set_data(key=pkey, val=1, expire=60)
|
|
|
|
|
|
|
|
+ # 打印have_ykey
|
|
|
|
+ return JsonResponse(status=200, data={'pkey': 0, 'have_ykey': have_ykey, 'have_pkey': have_pkey,
|
|
|
|
+ 'have_ykey': have_dkey})
|
|
|
|
+
|
|
# 旧模式并且没有pkey,重新创建一个
|
|
# 旧模式并且没有pkey,重新创建一个
|
|
if not detect_group and not have_pkey:
|
|
if not detect_group and not have_pkey:
|
|
# 设置推送时间为60秒一次
|
|
# 设置推送时间为60秒一次
|