Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple aerich commands fail to close Tortoise connections #120

Closed
AulonSal opened this issue Feb 19, 2021 · 1 comment
Closed

Multiple aerich commands fail to close Tortoise connections #120

AulonSal opened this issue Feb 19, 2021 · 1 comment

Comments

@AulonSal
Copy link
Contributor

AulonSal commented Feb 19, 2021

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.

@AulonSal AulonSal changed the title Multiple aerich commands do not close Tortoise connections Multiple aerich commands fail to close Tortoise connections Feb 19, 2021
@AulonSal
Copy link
Contributor Author

Fixed in #121, 49897dc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant