From 6047a3b2595b43529341b76034a6d68f18f54866 Mon Sep 17 00:00:00 2001 From: Untone Date: Fri, 13 Oct 2023 15:20:06 +0300 Subject: [PATCH] unread-counter-fix-2 --- services/unread.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/services/unread.py b/services/unread.py index 013234c7..42ed1090 100644 --- a/services/unread.py +++ b/services/unread.py @@ -7,8 +7,7 @@ async def get_unread_counter(chat_id: str, author_id: int): unread = await redis.execute( "LLEN", f"chats/{chat_id}/unread/{author_id}" ) - if unread: - return unread + return unread or 0 except Exception: return 0