update-author_cache

This commit is contained in:
2024-02-25 21:16:34 +03:00
parent 314c54969b
commit f596a9bf2c
4 changed files with 33 additions and 18 deletions

View File

@@ -55,7 +55,7 @@ async def get_author(_, _info, slug='', author_id=None):
q = select(aliased_author).where(aliased_author.id == author_id)
[author] = get_with_stat(q)
if author:
await update_author_cache(author)
await update_author_cache(author.dict())
else:
author = json.loads(cache)
except Exception as exc:
@@ -79,7 +79,7 @@ async def get_author_by_user_id(user_id: str):
[author] = get_with_stat(q)
if author:
await update_author_cache(author)
await update_author_cache(author.dict())
except Exception as exc:
logger.error(exc)
return author