async-fix

This commit is contained in:
Untone 2024-05-27 19:29:51 +03:00
parent 3f6f7f1aa0
commit f43624ca3d

View File

@ -319,7 +319,7 @@ async def get_author_followers(_, _info, slug: str):
try: try:
author_alias = aliased(Author) author_alias = aliased(Author)
author_query = select(author_alias).filter_by(slug=slug) author_query = select(author_alias).filter_by(slug=slug)
async with local_session() as session: with local_session() as session:
result = await session.execute(author_query).first() result = await session.execute(author_query).first()
if not result: if not result:
return [] return []
@ -358,6 +358,7 @@ async def get_author_followers(_, _info, slug: str):
return followers return followers
except Exception as exc: except Exception as exc:
import traceback import traceback
logger.error(exc) logger.error(exc)
logger.error(traceback.format_exc()) logger.error(traceback.format_exc())
return [] return []