diff --git a/services/redis.py b/services/redis.py index 3aa5f08..d33b6d5 100644 --- a/services/redis.py +++ b/services/redis.py @@ -11,7 +11,7 @@ class RedisCache: async def connect(self): self._redis = aredis.StrictRedis.from_url(self._uri, decode_responses=True) - response = await self._redis.execute('PING') + response = await self.execute('PING') print(f"[redis] PING response: {response}") async def disconnect(self): @@ -24,8 +24,9 @@ class RedisCache: try: print("[redis] " + command + " " + " ".join(args)) return await self._redis.execute_command(command, *args, **kwargs) - except Exception: - pass + except Exception as e: + print(f"[redis] error: {e}") + return None async def subscribe(self, *channels): if not self._redis: