From 2174a99a24c1da98ea8265d8475e7d6f219292de Mon Sep 17 00:00:00 2001 From: Untone Date: Sun, 26 Nov 2023 22:41:33 +0300 Subject: [PATCH] listener-fix-2 --- services/rediscache.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/rediscache.py b/services/rediscache.py index da69df1..23ad6bb 100644 --- a/services/rediscache.py +++ b/services/rediscache.py @@ -56,7 +56,10 @@ class RedisCache: while True: message = await pubsub.get_message() if message and isinstance(message['data'], (str, bytes, bytearray)): - yield json.loads(message['data']) + try: + yield json.loads(message['data']) + except json.JSONDecodeError as e: + print(f"Error decoding JSON: {e}") await asyncio.sleep(0.1)