mirror of
https://github.com/PaiGramTeam/MibooGram.git
synced 2024-11-16 04:45:27 +00:00
🔧 修改 RedisDB
模块日记输出信息
This commit is contained in:
parent
8caccc6d79
commit
ea9f8e349e
@ -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())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user