networking harden
This commit is contained in:
@@ -18,12 +18,13 @@ class Networking:
|
||||
print("Connected to " + input_socket_address + " and started server " + self.server_address)
|
||||
|
||||
def get(self, path):
|
||||
if self.retries < config.MAX_NETWORK_RETRIES:
|
||||
logging.error("Network exception. Could not get " + path)
|
||||
if self.retries > config.MAX_NETWORK_RETRIES:
|
||||
return
|
||||
|
||||
try:
|
||||
response = self.output_session.get(self.server_address + path)
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
logging.error("Network exception. Could not get " + path + " " + e)
|
||||
self.retries += 1
|
||||
sleep(config.NETWORK_SLEEP_TIME_SECONDS)
|
||||
return self.get(path)
|
||||
|
||||
Reference in New Issue
Block a user