From ea9f8e349e2114019fbe46be553983de2201e642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Thu, 4 Aug 2022 21:01:29 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20=E4=BF=AE=E6=94=B9=20`RedisDB`?= =?UTF-8?q?=20=E6=A8=A1=E5=9D=97=E6=97=A5=E8=AE=B0=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/redisdb.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/redisdb.py b/utils/redisdb.py index b4dd85a6..4023af94 100644 --- a/utils/redisdb.py +++ b/utils/redisdb.py @@ -10,8 +10,8 @@ class RedisDB: def __init__(self, host="127.0.0.1", port=6379, db=0, loop=None): Log.debug(f'获取Redis配置 [host]: {host}') - Log.debug(f'获取Redis配置 [host]: {port}') - Log.debug(f'获取Redis配置 [host]: {db}') + Log.debug(f'获取Redis配置 [port]: {port}') + Log.debug(f'获取Redis配置 [db]: {db}') self.client = aioredis.Redis(host=host, port=port, db=db) self.ttl = 600 self.key_prefix = "paimon_bot" @@ -23,8 +23,8 @@ class RedisDB: self._loop.run_until_complete(self.ping()) except (KeyboardInterrupt, SystemExit): pass - except Exception as exc: - Log.warning("尝试连接Redis失败,使用 fakeredis 模拟") + except BaseException as exc: + Log.warning("尝试连接Redis失败,使用 fakeredis 模拟", exc) self.client = fakeredis.aioredis.FakeRedis() self._loop.run_until_complete(self.ping())