🔧 修改 RedisDB 模块日记输出信息

This commit is contained in:
洛水居室 2022-08-04 21:01:29 +08:00
parent 8caccc6d79
commit ea9f8e349e
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -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())