From be1ffcbd130de17fb2692cd71cad41b2da8f8ddb Mon Sep 17 00:00:00 2001 From: sina <20732540+SinaKhalili@users.noreply.github.com> Date: Fri, 8 Nov 2024 09:09:07 -0800 Subject: [PATCH] Update asset liability cached serve --- src/lib/api.py | 2 +- src/page/asset_liability_cached.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/api.py b/src/lib/api.py index b9fc2de..10c0bf1 100644 --- a/src/lib/api.py +++ b/src/lib/api.py @@ -58,11 +58,11 @@ def api2(url: str, params: Optional[dict] = None) -> dict: print("SERVING FROM R2") try: - # Convert URL path to R2 filename format cache_key = f"GET/api/{url}".replace("/", "_") # Handle query parameters exactly as they appear in the URL if params: + print(f"Params: {params}") # Convert params to URL query string format query_parts = [] for k, v in params.items(): diff --git a/src/page/asset_liability_cached.py b/src/page/asset_liability_cached.py index d8701d7..ca24c6c 100644 --- a/src/page/asset_liability_cached.py +++ b/src/page/asset_liability_cached.py @@ -37,8 +37,10 @@ def asset_liab_matrix_cached_page(): st.query_params.update({"perp_market_index": perp_market_index}) try: - url = f"asset-liability/matrix/{0 if mode is None else mode}/{0 if perp_market_index is None else perp_market_index}" - result = api2(url) + result = api2( + "asset-liability/matrix", + params=params, + ) if "result" in result and result["result"] == "miss": st.write("Fetching data for the first time...") st.image(