Compare commits

...

2 Commits

Author SHA1 Message Date
Khaleel Al-Adhami
c54f24f2eb Merge branch 'main' into use-own-cached-templates-release 2025-01-07 10:37:14 -08:00
Khaleel Al-Adhami
0883426197 use own cached templates release 2024-12-03 18:41:19 -08:00
2 changed files with 8 additions and 3 deletions

View File

@ -78,7 +78,8 @@ class Reflex(SimpleNamespace):
# The root directory of the reflex library.
ROOT_DIR = Path(__file__).parents[2]
RELEASES_URL = "https://api.github.com/repos/reflex-dev/templates/releases"
RELEASES_URL = "https://templates-releases.reflex.dev"
RELEASES_URL_FALLBACK = "https://api.github.com/repos/reflex-dev/templates/releases"
class ReflexHostingCLI(SimpleNamespace):

View File

@ -1279,8 +1279,12 @@ def fetch_app_templates(version: str) -> dict[str, Template]:
"""
def get_release_by_tag(tag: str) -> dict | None:
try:
response = net.get(constants.Reflex.RELEASES_URL)
response.raise_for_status()
except Exception:
response = net.get(constants.Reflex.RELEASES_URL_FALLBACK)
response.raise_for_status()
releases = response.json()
for release in releases:
if release["tag_name"] == f"v{tag}":