We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f5f83d commit c09f9feCopy full SHA for c09f9fe
db.py
@@ -18,6 +18,8 @@ async def init_db(create_db: bool = False) -> None:
18
_create_db=create_db
19
)
20
21
+async def close() -> None:
22
+ await Tortoise.close_connections()
23
24
async def init():
25
await init_db(create_db=True)
main.py
@@ -51,6 +51,9 @@ async def main():
51
crawler_type=args.type
52
53
await crawler.start()
54
+
55
+ if config.SAVE_DATA_OPTION == "db":
56
+ await db.close()
57
58
59
if __name__ == '__main__':
0 commit comments