From 059dd0f9b4e1ccc15b2a3792e318f70422d4ced2 Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 11 Mar 2024 17:07:37 +0300 Subject: [PATCH] remove-follow-debug --- services/cache.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/cache.py b/services/cache.py index e0d4418e..98bf3ad7 100644 --- a/services/cache.py +++ b/services/cache.py @@ -66,9 +66,12 @@ async def update_follows_for_author( if is_insert: follows.append(entity) else: + entity_id = entity.get('id') + if not entity_id: + raise Exception('wrong entity') # Remove the entity from follows - follows = [e for e in follows if e['id'] != entity['id']] - logger.debug(f'{entity} removed from follows') + follows = [e for e in follows if e['id'] != entity_id] + logger.debug(f'{entity['slug']} removed from what @{follower.slug} follows') if entity_type == 'topic': await set_follows_topics_cache(follows, follower.id) if entity_type == 'author':