Explorar o código

缓存APP消息推送参数

zhangdongming hai 1 ano
pai
achega
3bff8e77b8
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      Service/DevicePushService.py

+ 5 - 0
Service/DevicePushService.py

@@ -160,6 +160,11 @@ class DevicePushService:
         redis_obj = RedisObject(3)
         # 推送
         if is_app_push:
+            msg_key = 'PUSH:MSG:IMAGE:{}:{}:{}'.format(params['uid'], params['channel'], params['n_time'])
+            d_params = {'is_st': params['is_st'], 'storage_location': params['storage_location'],
+                        'event_tag': params['event_tag'], 'event_type': params['event_type']}
+            redis_obj.set_data(msg_key, json.dumps(d_params), 60)
+
             push_kwargs = params['push_kwargs']
             for up in params['uid_set_push_list']:
                 push_type = up['push_type']