bugfixing
This commit is contained in:
parent
0cc56b934d
commit
1c2be8f924
@ -403,7 +403,7 @@ async def get_stock(data: HistoricalPrice, api_key: str = Security(get_api_key))
|
|||||||
async def get_stock(data: HistoricalPrice, api_key: str = Security(get_api_key)):
|
async def get_stock(data: HistoricalPrice, api_key: str = Security(get_api_key)):
|
||||||
ticker = data.ticker.upper()
|
ticker = data.ticker.upper()
|
||||||
time_period = data.timePeriod
|
time_period = data.timePeriod
|
||||||
|
print(time_period)
|
||||||
cache_key = f"export-price-data-{ticker}-{time_period}"
|
cache_key = f"export-price-data-{ticker}-{time_period}"
|
||||||
cached_result = redis_client.get(cache_key)
|
cached_result = redis_client.get(cache_key)
|
||||||
if cached_result:
|
if cached_result:
|
||||||
@ -415,7 +415,7 @@ async def get_stock(data: HistoricalPrice, api_key: str = Security(get_api_key))
|
|||||||
|
|
||||||
if time_period == '1day':
|
if time_period == '1day':
|
||||||
try:
|
try:
|
||||||
with open(f"json/historical-price/{time_period}/{ticker}.json", 'rb') as file:
|
with open(f"json/historical-price/max/{ticker}.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