This commit is contained in:
@@ -71,6 +71,7 @@ async def get_author(_, _info, slug='', author_id=None):
|
||||
q = select(Author).where(Author.id == author_id)
|
||||
[author] = await get_authors_with_stat_cached(q)
|
||||
if author:
|
||||
logger.debug(f'queried author from db {cache_key} -> {cache}')
|
||||
author_dict = author.dict()
|
||||
else:
|
||||
logger.warn('author was not cached!')
|
||||
|
@@ -197,6 +197,7 @@ def get_with_stat(q):
|
||||
|
||||
|
||||
async def get_authors_with_stat_cached(q):
|
||||
logger.debug(q)
|
||||
try:
|
||||
records = []
|
||||
with local_session() as session:
|
||||
|
Reference in New Issue
Block a user