From 04f7231fe9ea35442eb7c9f0a60ff5759390274a Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 12 Mar 2024 10:36:34 +0300 Subject: [PATCH] refactored-2 --- services/cache.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/services/cache.py b/services/cache.py index 64fca49b..474ddf5d 100644 --- a/services/cache.py +++ b/services/cache.py @@ -187,13 +187,11 @@ def after_author_follower_insert(mapper, connection, target: AuthorFollower): @event.listens_for(AuthorFollower, 'after_delete') def after_author_follower_delete(mapper, connection, target: AuthorFollower): asyncio.create_task( - handle_author_follower_change(connection, target.author, target.follower, False) + handle_author_follower_change(target.author, target.follower, False) ) -async def handle_author_follower_change( - connection, author_id: int, follower_id: int, is_insert: bool -): +async def handle_author_follower_change(author_id: int, follower_id: int, is_insert: bool): author_query = select(Author).select_from(Author).filter(Author.id == author_id) [author] = get_with_stat(author_query) follower_query = select(Author).select_from(Author).filter(Author.id == follower_id)