bugfixing
This commit is contained in:
parent
ce08cdef51
commit
e93bc9b780
@ -3678,9 +3678,9 @@ 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: FilterStockList, api_key: str = Security(get_api_key)):
|
||||||
ticker = data.ticker.lower()
|
filter_list = data.filterList.lower()
|
||||||
cache_key = f"industry-stocks-{ticker}"
|
cache_key = f"industry-stocks-{filter_list}"
|
||||||
cached_result = redis_client.get(cache_key)
|
cached_result = redis_client.get(cache_key)
|
||||||
if cached_result:
|
if cached_result:
|
||||||
return StreamingResponse(
|
return StreamingResponse(
|
||||||
@ -3689,7 +3689,7 @@ async def get_sector_overview(data: TickerData, api_key: str = Security(get_api_
|
|||||||
headers={"Content-Encoding": "gzip"}
|
headers={"Content-Encoding": "gzip"}
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
with open(f"json/industry/industries/{ticker}.json", 'rb') as file:
|
with open(f"json/industry/industries/{filter_list}.json", 'rb') as file:
|
||||||
res = orjson.loads(file.read())
|
res = orjson.loads(file.read())
|
||||||
except:
|
except:
|
||||||
res = {}
|
res = {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user