diff --git a/utils/mariadb.py b/utils/mariadb.py index 5d8666b..2fb20ac 100644 --- a/utils/mariadb.py +++ b/utils/mariadb.py @@ -12,17 +12,19 @@ def make_cache() -> tuple[list[dict[str, str]], list[dict[str, str]]]: return_list = [] latest_meta = [] live_version_branches = [b["release_id"] for b in httpx.get(VERSIONS_API).json()["major_releases"] - if b["release_status"] == "Stable"] + if b["release_status"] == "Stable" and b["release_support_type"] == "Long Term Support"] version_branches = list(set(oneinstack_compatible_versions + live_version_branches)) version_branches.sort(reverse=True) logger.info(f"Available MariaDB versions: {version_branches}") for version in version_branches: + logger.info(f"Fetching MariaDB version {version}") this_branch_latest_meta = { "version_file_name": f"mariadb{version.replace(".", "")}_ver", "version": None } this_version_packages = [] - patch_list = list(httpx.get(VERSION_RESOURCE_API.format(version=version)).json()["releases"].values()) + rsp = httpx.get(VERSION_RESOURCE_API.format(version=version)).json() + patch_list = list(rsp["releases"].values()) for patch in patch_list: try: linux_package = [f for f in patch["files"] if f["os"] == "Linux" and f["cpu"].lower() == "x86_64" @@ -46,3 +48,7 @@ def make_cache() -> tuple[list[dict[str, str]], list[dict[str, str]]]: for meta in latest_meta: logger.info(f"Latest MariaDB version for {meta['version_file_name']} is {meta['version']}") return return_list, latest_meta + + +if __name__ == "__main__": + make_cache() \ No newline at end of file