@@ -40,12 +40,14 @@ def __init__(self, config: Configuration):
4040
4141 retry_strategy = Retry (
4242 total = 3 ,
43+ connect = 5 ,
4344 backoff_factor = 0.5 ,
4445 status_forcelist = [500 , 502 , 503 , 504 ],
46+ raise_on_status = True ,
4547 )
4648
4749 self .session = requests .Session ()
48- adapter = HTTPAdapter (pool_connections = 1 , pool_maxsize = 20 , pool_block = True , max_retries = retry_strategy )
50+ adapter = HTTPAdapter (pool_connections = 1 , pool_maxsize = 20 , pool_block = False , max_retries = retry_strategy )
4951 self .session .mount ("https://" , adapter )
5052
5153 self .vaultID = config .vaultID
@@ -65,16 +67,18 @@ def insert(self, records: dict, options: InsertOptions = InsertOptions()):
6567 self .storedToken , self .tokenProvider , interface )
6668 headers = {
6769 "Authorization" : "Bearer " + self .storedToken ,
68- "sky-metadata" : json .dumps (getMetrics ())
70+ "sky-metadata" : json .dumps (getMetrics ()),
71+ # "User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
6972 }
7073 # response = requests.post(requestURL, data=jsonBody, headers=headers)
7174 response = self .session .post (
7275 requestURL ,
7376 data = jsonBody ,
7477 headers = headers ,
78+ # timeout=(5, 300),
7579 )
7680 processedResponse = processResponse (response )
77- print (">>> processedResponse" , processedResponse )
81+ print (">>> processedResponse local: " , processedResponse )
7882 result , partial = convertResponse (records , processedResponse , options )
7983 if partial :
8084 log_error (SkyflowErrorMessages .BATCH_INSERT_PARTIAL_SUCCESS .value , interface )
0 commit comments