Просмотр исходного кода

异步推送定制化消息和保存数据

locky 1 год назад
Родитель
Сommit
5c25e614d8
2 измененных файлов с 5 добавлено и 7 удалено
  1. 5 5
      Controller/CustomizedPushController.py
  2. 0 2
      Service/CustomizedPushService.py

+ 5 - 5
Controller/CustomizedPushController.py

@@ -52,12 +52,12 @@ class CustomizedPushView(View):
                 'register_period': customized_push_qs[0]['register_period'],
                 'push_app': customized_push_qs[0]['push_app']
             }
-            customized_push(**kwargs)
+            # customized_push(**kwargs)
             # 异步推送消息和保存数据
-            # push_thread = threading.Thread(
-            #     target=customized_push,
-            #     kwargs=kwargs)
-            # push_thread.start()
+            push_thread = threading.Thread(
+                target=customized_push,
+                kwargs=kwargs)
+            push_thread.start()
 
             # 更新推送状态
             customized_push_qs.update(push_satus=True)

+ 0 - 2
Service/CustomizedPushService.py

@@ -77,8 +77,6 @@ class CustomizedPushObject:
         msg = kwargs['msg']
         link = kwargs['link']
         icon_link = kwargs['icon_link'] if kwargs['icon_link'] != '' else None
-        if icon_link is not None:
-            icon_link = icon_link.encode('UTF-8', 'ignore').decode('UTF-8')
 
         n_time = int(time.time())
         push_kwargs = {