networking harden

This commit is contained in:
Jonas Zeunert
2022-06-06 23:56:47 +02:00
parent b696f30463
commit 40e90972e4

View File

@@ -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)