Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

locky 1 rok pred
rodič
commit
fe88952b23
2 zmenil súbory, kde vykonal 5 pridanie a 4 odobranie
  1. 2 2
      Service/DevicePushService.py
  2. 3 2
      Service/PushService.py

+ 2 - 2
Service/DevicePushService.py

@@ -461,8 +461,8 @@ class DevicePushService:
                                        content=push_kwargs, push_result=push_result, push_type=push_type)
                                        content=push_kwargs, push_result=push_result, push_type=push_type)
             return push_result
             return push_result
         except Exception as e:
         except Exception as e:
-            ERROR_INFO_LOGGER.info(
-                '发送推送线程异常uid:{},error_line:{},error_msg:{}'.format(kwargs['uid'], e.__traceback__.tb_lineno, repr(e)))
+            ERROR_INFO_LOGGER.info('发送推送线程异常uid:{},type:{},error_line:{},error_msg:{}'
+                                   .format(kwargs['uid'], kwargs['push_type'], e.__traceback__.tb_lineno, repr(e)))
             return False
             return False
 
 
     @staticmethod
     @staticmethod

+ 3 - 2
Service/PushService.py

@@ -135,8 +135,9 @@ class PushObject:
                                     mutable_content=True)
                                     mutable_content=True)
             n = apns2.Notification(payload=payload, priority=apns2.PRIORITY_LOW)
             n = apns2.Notification(payload=payload, priority=apns2.PRIORITY_LOW)
             res = cli.push(n=n, device_token=token_val, topic=app_bundle_id)
             res = cli.push(n=n, device_token=token_val, topic=app_bundle_id)
-            LOGGER.info('IOS推送响应状态码{},params,uid:{},{}'.format(res.status_code, uid, json.dumps(push_data)))
-            assert res.status_code == 200
+            LOGGER.info('IOS推送响应状态码{},token:{},uid:{},params:{}'
+                        .format(res.status_code, token_val, uid, json.dumps(push_data)))
+            assert res.status_code == 200 or res.status_code == 410
             return True
             return True
         except Exception as e:
         except Exception as e:
             LOGGER.info('IOS推送异常: {}, 证书路径: {}'.format(repr(e), pem_path))
             LOGGER.info('IOS推送异常: {}, 证书路径: {}'.format(repr(e), pem_path))