bugfixing

This commit is contained in:
MuslemRahimi 2024-12-04 19:14:42 +01:00
parent b16a91b9a4
commit ce08cdef51

View File

@ -3679,7 +3679,7 @@ async def get_sector_overview(api_key: str = Security(get_api_key)):
@app.post("/industry-stocks") @app.post("/industry-stocks")
async def get_sector_overview(data: TickerData, api_key: str = Security(get_api_key)): async def get_sector_overview(data: TickerData, api_key: str = Security(get_api_key)):
ticker = data.ticker.upper() ticker = data.ticker.lower()
cache_key = f"industry-stocks-{ticker}" cache_key = f"industry-stocks-{ticker}"
cached_result = redis_client.get(cache_key) cached_result = redis_client.get(cache_key)
if cached_result: if cached_result:
@ -3693,7 +3693,6 @@ async def get_sector_overview(data: TickerData, api_key: str = Security(get_api_
res = orjson.loads(file.read()) res = orjson.loads(file.read())
except: except:
res = {} res = {}
data = orjson.dumps(res) data = orjson.dumps(res)
compressed_data = gzip.compress(data) compressed_data = gzip.compress(data)