add retry
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import requests_unixsocket as req
|
||||
|
||||
import socket
|
||||
import json
|
||||
|
||||
@@ -8,9 +9,8 @@ class Networking:
|
||||
self.server_address = ""
|
||||
self.input_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
self.output_session = req.Session()
|
||||
retries = Retry(total=10,
|
||||
backoff_factor=0.2)
|
||||
self.output_session.mount('http+unix://', retries)
|
||||
adapter = req.adapters.HTTPAdapter(max_retries=20)
|
||||
self.output_session.mount('http+unix://', adapter)
|
||||
self.server_address = "http+unix://" + output_server_address.replace("/", "%2F")
|
||||
self.input_socket.connect(input_socket_address)
|
||||
print("Connected to " + input_socket_address + " and started server " + self.server_address)
|
||||
|
||||
Reference in New Issue
Block a user