Refine
This commit is contained in:
4
main.py
4
main.py
@@ -2326,7 +2326,7 @@ async def fastapi_query_all_records_by_date(querydate: str) -> dict[str, list]:
|
||||
global redis_client
|
||||
|
||||
# 今天的不要去缓存
|
||||
if not time_api.is_today(querydate):
|
||||
if not time_api.is_today_or_future(querydate):
|
||||
cache_key = f"queryallrecordsbydate_{querydate}"
|
||||
data = redis_client.get(cache_key)
|
||||
if data:
|
||||
@@ -2339,7 +2339,7 @@ async def fastapi_query_all_records_by_date(querydate: str) -> dict[str, list]:
|
||||
"links": nodes_links[1] }
|
||||
|
||||
# 今天的不要去缓存
|
||||
if not time_api.is_today(querydate):
|
||||
if not time_api.is_today_or_future(querydate):
|
||||
redis_client.set(cache_key, msgpack.packb(results, default=encode_datetime))
|
||||
|
||||
return results
|
||||
|
||||
Reference in New Issue
Block a user