diff --git a/src/rocm_docs/rocm_docs_theme/flavors/rocm/header.jinja b/src/rocm_docs/rocm_docs_theme/flavors/rocm/header.jinja index ba3c0a9d..55828364 100644 --- a/src/rocm_docs/rocm_docs_theme/flavors/rocm/header.jinja +++ b/src/rocm_docs/rocm_docs_theme/flavors/rocm/header.jinja @@ -1,8 +1,6 @@ {% macro top_level_header(branch, latest_version, release_candidate_version) -%} {% if branch in ["develop", "master", "main", "amd-master", "amd-staging"] %} {% set version_name = "Future Release" %} - {% elif release_candidate_version in branch %} - {% set version_name = release_candidate_version %} {% elif branch == "latest" %} {% set version_name = latest_version %} {% else %} diff --git a/src/rocm_docs/theme.py b/src/rocm_docs/theme.py index bd28531f..cb172549 100644 --- a/src/rocm_docs/theme.py +++ b/src/rocm_docs/theme.py @@ -2,6 +2,7 @@ from typing import Any +import time from pathlib import Path import requests @@ -16,10 +17,19 @@ logger = sphinx.util.logging.getLogger(__name__) +MAX_RETRY = 20 + def _get_version_from_url(url: str) -> str: try: + retry_counter = 0 response = requests.get(url) + + # Retry in case of failure + while (response.status_code != 200) and (retry_counter <= MAX_RETRY): + time.sleep(5) + response = requests.get(url) + return response.text.strip() except requests.RequestException as e: print(f"Error in rocm-docs-core _get_version_from_url: {e}")