mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
🔧 移除db_url参数以简化数据库配置获取逻辑
This commit is contained in:
parent
f693012927
commit
36316e21ec
@ -357,7 +357,7 @@ SQLITE_CONFIG = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def get_config(db_url: str) -> dict:
|
def get_config() -> dict:
|
||||||
"""获取数据库配置"""
|
"""获取数据库配置"""
|
||||||
parsed = urlparse(BotConfig.db_url)
|
parsed = urlparse(BotConfig.db_url)
|
||||||
|
|
||||||
@ -426,7 +426,7 @@ async def init():
|
|||||||
raise DbUrlIsNode("\n" + error.strip())
|
raise DbUrlIsNode("\n" + error.strip())
|
||||||
try:
|
try:
|
||||||
await Tortoise.init(
|
await Tortoise.init(
|
||||||
config=get_config(BotConfig.db_url),
|
config=get_config(),
|
||||||
)
|
)
|
||||||
if SCRIPT_METHOD:
|
if SCRIPT_METHOD:
|
||||||
db = Tortoise.get_connection("default")
|
db = Tortoise.get_connection("default")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user