Skip to content

Commit

Permalink
fix: issue with cg api where cache was being corrupted with a specifi…
Browse files Browse the repository at this point in the history
…c query combo
  • Loading branch information
robcxyz committed Oct 29, 2024
1 parent 793bce1 commit 7c90333
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion balanced_backend/api/v1/endpoints/coingecko.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ async def get_coingecko_trades(
response.headers["x-total-count"] = str(len(cache.coingecko_historical))
output = cache.coingecko_historical
if type:
type_output = {}
for k, v in output.items():
output[k] = output[k][type]
type_output[k] = output[k][type]
return type_output
return output
try:
output = cache.coingecko_historical[ticker_id]
Expand Down
3 changes: 3 additions & 0 deletions balanced_backend/cache/cmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
if TYPE_CHECKING:
from sqlalchemy.orm import Session

# Ideal Endpoint Documentation
# https://docs.google.com/document/d/1S4urpzUnO2t7DmS_1dc4EL4tgnnbTObPYXvDeBnukCg/edit


def update_cmc_summary(session: 'Session'):
logger.info("Updating cmc summary cache...")
Expand Down

0 comments on commit 7c90333

Please sign in to comment.