Skip to content

Commit

Permalink
Update asset liability cached serve
Browse files Browse the repository at this point in the history
  • Loading branch information
SinaKhalili committed Nov 8, 2024
1 parent 3b01312 commit be1ffcb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
6 changes: 4 additions & 2 deletions src/page/asset_liability_cached.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit be1ffcb

Please sign in to comment.