Problem: Aerich commands that interact with the database do not close connections after finishing execution forcing you to manually kill the program.
What steps will reproduce the problem?
Run init-db, downgrade, or any of the other commands that interact with the database with sqlite.
Expected Result
All commands that interact with the database await Tortoise.close_connections() before returning, as recommended in https://tortoise-orm.readthedocs.io/en/latest/setup.html#the-importance-of-cleaning-up,
using an async context manager with with clauses enclosing just the db code or a decorator wrapping the commands, it would be even simpler to just run until complete in the coro decorator.
Problem: Aerich commands that interact with the database do not close connections after finishing execution forcing you to manually kill the program.
What steps will reproduce the problem? Run init-db, downgrade, or any of the other commands that interact with the database with sqlite.
Expected Result All commands that interact with the database
await Tortoise.close_connections()
before returning, as recommended in https://tortoise-orm.readthedocs.io/en/latest/setup.html#the-importance-of-cleaning-up, using an async context manager withwith
clauses enclosing just the db code or a decorator wrapping the commands, it would be even simpler to just run until complete in the coro decorator.