fix-revalidation
All checks were successful
Deploy on push / deploy (push) Successful in 59s

This commit is contained in:
Untone 2025-02-04 00:01:54 +03:00
parent 33ddfc6c31
commit 84de0c5538
2 changed files with 5 additions and 3 deletions

2
cache/triggers.py vendored
View File

@ -77,7 +77,7 @@ def after_reaction_handler(mapper, connection, target):
# Обновляем счетчики для автора комментария # Обновляем счетчики для автора комментария
if target.created_by: if target.created_by:
revalidation_manager.mark_for_revalidation(target.created_by.id, "authors") revalidation_manager.mark_for_revalidation(target.created_by, "authors")
# Обновляем счетчики для поста и его авторов/тем # Обновляем счетчики для поста и его авторов/тем
revalidation_manager.mark_for_revalidation(shout.id, "shouts") revalidation_manager.mark_for_revalidation(shout.id, "shouts")

View File

@ -281,8 +281,10 @@ async def create_reaction(_, info, reaction):
logger.debug(f"Creating reaction with data: {reaction_input}") logger.debug(f"Creating reaction with data: {reaction_input}")
logger.debug(f"Author ID: {author_id}, Shout ID: {shout_id}") logger.debug(f"Author ID: {author_id}, Shout ID: {shout_id}")
if not shout_id or not author_id: if not author_id:
return {"error": "Shout ID and author ID are required to create a reaction."} return {"error": "Author ID is required to create a reaction."}
if not shout_id:
return {"error": "Shout ID is required to create a reaction."}
try: try:
with local_session() as session: with local_session() as session: