cache-author-fiz
This commit is contained in:
parent
8f3fded5fe
commit
4c126fd859
5
cache/cache.py
vendored
5
cache/cache.py
vendored
|
@ -72,8 +72,9 @@ async def get_cached_author(author_id: int, get_with_stat):
|
||||||
return json.loads(result)
|
return json.loads(result)
|
||||||
# Load from database if not found in cache
|
# Load from database if not found in cache
|
||||||
q = select(Author).where(Author.id == author_id)
|
q = select(Author).where(Author.id == author_id)
|
||||||
author = get_with_stat(q)
|
authors = get_with_stat(q)
|
||||||
if author:
|
if authors:
|
||||||
|
author = authors[0]
|
||||||
await cache_author(author.dict())
|
await cache_author(author.dict())
|
||||||
return author.dict()
|
return author.dict()
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user