|
@@ -76,9 +76,9 @@ class NotificationV2View(View):
|
|
|
req_limiting = '{}_{}_{}_ptl'.format(uid, channel, event_type)
|
|
|
cache_req_limiting = redis_obj.get_data(key=req_limiting) # 获取请求限流缓存数据
|
|
|
cache_app_push = redis_obj.get_data(key=push_interval) # 获取APP推送消息时间间隔缓存数据
|
|
|
- if event_type not in [606, 607]:
|
|
|
- if cache_req_limiting: # 限流存在则直接返回
|
|
|
- return JsonResponse(status=200, data={'code': 0, 'msg': 'Push again in one minute'})
|
|
|
+ # if event_type not in [606, 607]:
|
|
|
+ # if cache_req_limiting: # 限流存在则直接返回
|
|
|
+ # return JsonResponse(status=200, data={'code': 0, 'msg': 'Push again in one minute'})
|
|
|
redis_obj.set_data(key=req_limiting, val=1, expire=60) # 当缓存不存在限流数据 重新设置一分钟请求一次
|
|
|
|
|
|
# 查询uid_push和uid_set数据
|
|
@@ -128,10 +128,11 @@ class NotificationV2View(View):
|
|
|
'uid_set_push_list': uid_set_push_list}
|
|
|
|
|
|
# 异步推送消息和保存数据
|
|
|
- push_thread = threading.Thread(
|
|
|
- target=push_and_save_data,
|
|
|
- kwargs=params)
|
|
|
- push_thread.start()
|
|
|
+ push_and_save_data(**params)
|
|
|
+ # push_thread = threading.Thread(
|
|
|
+ # target=push_and_save_data,
|
|
|
+ # kwargs=params)
|
|
|
+ # push_thread.start()
|
|
|
|
|
|
# 视频通话不返回图片链接
|
|
|
if event_type == 607:
|