mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-06-09 03:17:25 +08:00
fix: 增加db.close(),解决抓取命令执行完不退出的问题
This commit is contained in:
2
db.py
2
db.py
@@ -18,6 +18,8 @@ async def init_db(create_db: bool = False) -> None:
|
|||||||
_create_db=create_db
|
_create_db=create_db
|
||||||
)
|
)
|
||||||
|
|
||||||
|
async def close() -> None:
|
||||||
|
await Tortoise.close_connections()
|
||||||
|
|
||||||
async def init():
|
async def init():
|
||||||
await init_db(create_db=True)
|
await init_db(create_db=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user