mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 18:04:10 +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):
|
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]: {host}')
|
||||||
Log.debug(f'获取Redis配置 [host]: {port}')
|
Log.debug(f'获取Redis配置 [port]: {port}')
|
||||||
Log.debug(f'获取Redis配置 [host]: {db}')
|
Log.debug(f'获取Redis配置 [db]: {db}')
|
||||||
self.client = aioredis.Redis(host=host, port=port, db=db)
|
self.client = aioredis.Redis(host=host, port=port, db=db)
|
||||||
self.ttl = 600
|
self.ttl = 600
|
||||||
self.key_prefix = "paimon_bot"
|
self.key_prefix = "paimon_bot"
|
||||||
@ -23,8 +23,8 @@ class RedisDB:
|
|||||||
self._loop.run_until_complete(self.ping())
|
self._loop.run_until_complete(self.ping())
|
||||||
except (KeyboardInterrupt, SystemExit):
|
except (KeyboardInterrupt, SystemExit):
|
||||||
pass
|
pass
|
||||||
except Exception as exc:
|
except BaseException as exc:
|
||||||
Log.warning("尝试连接Redis失败,使用 fakeredis 模拟")
|
Log.warning("尝试连接Redis失败,使用 fakeredis 模拟", exc)
|
||||||
self.client = fakeredis.aioredis.FakeRedis()
|
self.client = fakeredis.aioredis.FakeRedis()
|
||||||
self._loop.run_until_complete(self.ping())
|
self._loop.run_until_complete(self.ping())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user