From d6202561a9c1a279e00519e8f00d1bd3f8523a65 Mon Sep 17 00:00:00 2001 From: Untone Date: Sat, 3 May 2025 11:07:03 +0300 Subject: [PATCH] unpublish-fix4 --- resolvers/editor.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resolvers/editor.py b/resolvers/editor.py index 92bafc4b..94c08063 100644 --- a/resolvers/editor.py +++ b/resolvers/editor.py @@ -745,8 +745,14 @@ async def unpublish_shout(_, info, shout_id: int): # Инвалидация кэша try: + cache_keys = [ + "feed", # лента + f"author_{author_id}", # публикации автора + "random_top", # случайные топовые + "unrated", # неоцененные + ] await invalidate_shout_related_cache(shout, author_id) - await invalidate_shouts_cache() + await invalidate_shouts_cache(cache_keys) logger.info(f"Cache invalidated after unpublishing shout {shout_id}") except Exception as cache_err: logger.error(f"Failed to invalidate cache for unpublish shout {shout_id}: {cache_err}")