|
@@ -93,7 +93,7 @@ class NotificationView(View):
|
|
values('token_val', 'app_type', 'appBundleId', 'm_code',
|
|
values('token_val', 'app_type', 'appBundleId', 'm_code',
|
|
'push_type', 'userID_id', 'userID__NickName',
|
|
'push_type', 'userID_id', 'userID__NickName',
|
|
'lang', 'm_code', 'tz', 'uid_set__nickname', 'uid_set__detect_interval', 'uid_set__detect_group',
|
|
'lang', 'm_code', 'tz', 'uid_set__nickname', 'uid_set__detect_interval', 'uid_set__detect_group',
|
|
- 'uid_set__channel')
|
|
|
|
|
|
+ 'uid_set__channel', 'uid_set__new_detect_interval')
|
|
|
|
|
|
uid_push_list = []
|
|
uid_push_list = []
|
|
for qs in uid_push_qs:
|
|
for qs in uid_push_qs:
|
|
@@ -121,16 +121,12 @@ class NotificationView(View):
|
|
else:
|
|
else:
|
|
detect_med_type = 2 # 为2的话,既推送,又存库
|
|
detect_med_type = 2 # 为2的话,既推送,又存库
|
|
# detect_group=0允许全部推送的时候
|
|
# detect_group=0允许全部推送的时候
|
|
- if detect_group == '0' or detect_group == '':
|
|
|
|
- redisObj.set_data(key=dkey, val=1, expire=detect_interval)
|
|
|
|
- else:
|
|
|
|
- detect_group_list = detect_group.split(',')
|
|
|
|
- if event_type in detect_group_list:
|
|
|
|
- if detect_interval < 60:
|
|
|
|
- detect_interval = 60
|
|
|
|
- redisObj.set_data(key=dkey, val=1, expire=detect_interval)
|
|
|
|
|
|
+ new_detect_interval = uid_push_list[0]['uid_set__new_detect_interval']
|
|
|
|
+ detect_interval = new_detect_interval if new_detect_interval > 0 else detect_interval
|
|
|
|
+ detect_interval = 60 if detect_interval < 60 else detect_interval
|
|
|
|
+ redisObj.set_data(key=dkey, val=1, expire=detect_interval-5)
|
|
redisObj.set_data(key=pkey, val=1, expire=60)
|
|
redisObj.set_data(key=pkey, val=1, expire=60)
|
|
-
|
|
|
|
|
|
+ logger.info('APP消息推送V1接口,是否进行APP推送:{},1为不推送,间隔:{}'.format(detect_med_type, detect_interval))
|
|
# 旧模式并且没有pkey,重新创建一个
|
|
# 旧模式并且没有pkey,重新创建一个
|
|
if not detect_group and not have_pkey:
|
|
if not detect_group and not have_pkey:
|
|
redisObj.set_data(key=pkey, val=1, expire=60)
|
|
redisObj.set_data(key=pkey, val=1, expire=60)
|
|
@@ -209,6 +205,7 @@ class NotificationView(View):
|
|
|
|
|
|
# 推送
|
|
# 推送
|
|
if detect_med_type == 2 or detect_med_type == 0:
|
|
if detect_med_type == 2 or detect_med_type == 0:
|
|
|
|
+ logger.info('准备推送{}'.format(detect_med_type))
|
|
try:
|
|
try:
|
|
if push_type == 0: # ios apns
|
|
if push_type == 0: # ios apns
|
|
do_apns_code = self.do_apns(**kwag_args)
|
|
do_apns_code = self.do_apns(**kwag_args)
|