fix&refactor: improve connection retry logic and remove unnecessary wait time for AWS instance readiness
This commit is contained in:
@@ -51,7 +51,17 @@ class SetupController:
|
||||
"parameters": dick like {str, Any} providing the keyword
|
||||
parameters
|
||||
}
|
||||
"""
|
||||
"""
|
||||
# make sure connection can be established
|
||||
retry = 0
|
||||
while retry < 30:
|
||||
try:
|
||||
_ = requests.get(self.http_server + "/terminal")
|
||||
break
|
||||
except:
|
||||
time.sleep(5)
|
||||
retry += 1
|
||||
logger.info(f"try to connect {self.http_server}, retry {retry}/30")
|
||||
|
||||
for cfg in config:
|
||||
config_type: str = cfg["type"]
|
||||
|
||||
Reference in New Issue
Block a user