فهرست منبع

修复附件数据处理异常Failed to establish a new connection

luojiehua 1 سال پیش
والد
کامیت
a60d5d3db2
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      BaseDataMaintenance/dataSource/interface.py

+ 2 - 1
BaseDataMaintenance/dataSource/interface.py

@@ -35,7 +35,8 @@ def getAttachDealInterface(_data,_type,path="",restry=1,kwargs={},url=interface_
             if len(kwargs.keys())>0:
                 _json.update(kwargs)
             headers = {"Content-Type":"application/json","Connection":"close"}
-            _resp = requests.post(url,data=_json,timeout=timeout,headers=headers)
+            with requests.Session() as session:
+                _resp = session.post(url,data=_json,timeout=timeout,headers=headers)
 
             if _resp.status_code==200:
                 _result = json.loads(_resp.content.decode())