following
All checks were successful
Deploy on push / deploy (push) Successful in 6m9s

This commit is contained in:
2025-08-30 21:38:27 +03:00
parent 98f625ec0d
commit c9733ece24
2 changed files with 6 additions and 0 deletions

1
cache/cache.py vendored
View File

@@ -318,6 +318,7 @@ async def get_cached_follower_authors(author_id: int):
logger.debug(f"[get_cached_follower_authors] Cache HIT for {cache_key}: {len(authors_ids)} authors")
else:
logger.debug(f"[get_cached_follower_authors] Cache MISS for {cache_key}, querying DB")
logger.info("[get_cached_follower_authors] Cache MISS - this should happen after follow/unfollow operations")
# Query authors from database
with local_session() as session:
authors_ids = [

View File

@@ -129,6 +129,11 @@ async def follow(
logger.debug("Обновление кэша сущности")
await cache_method(entity_dict)
# Инвалидируем кэш подписок пользователя для обновления списка подписок
cache_key_pattern = f"author:follows-{entity_type}s:{follower_id}"
await redis.execute("DEL", cache_key_pattern)
logger.debug(f"Инвалидирован кэш подписок: {cache_key_pattern}")
if what == "AUTHOR" and not existing_sub:
logger.debug("Отправка уведомления автору о подписке")
if isinstance(follower_dict, dict) and isinstance(entity_id, int):