diff --git a/utils/redisdb.py b/utils/redisdb.py index b4dd85a..4023af9 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())