Skip to content

Commit

Permalink
add timeout to container app ping for ssh/logstream
Browse files Browse the repository at this point in the history
  • Loading branch information
StrawnSC committed May 5, 2022
1 parent a4590f4 commit 1b8c7e0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/containerapp/azext_containerapp/_ssh_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,12 @@ def _getch_windows():
def ping_container_app(app):
site = safe_get(app, "properties", "configuration", "ingress", "fqdn")
if site:
resp = requests.get(f'https://{site}')
if not resp.ok:
logger.info(f"Got bad status pinging app: {resp.status_code}")
try:
resp = requests.get(f'https://{site}', timeout=30)
if not resp.ok:
logger.info(f"Got bad status pinging app: {resp.status_code}")
except requests.exceptions.ReadTimeout:
logger.info("Timed out while pinging app external URL")
else:
logger.info("Could not fetch site external URL")

Expand Down

0 comments on commit 1b8c7e0

Please sign in to comment.