Close connections in the init_db wrapper

This commit is contained in:
Konstantin Mikhailov 2022-09-29 08:09:59 +10:00 committed by GitHub
parent 20aebc4413
commit d7ecd97e88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,7 +30,7 @@ def coro(f):
try:
loop.run_until_complete(f(*args, **kwargs))
finally:
if f.__name__ not in ["cli", "init_db", "init"]:
if f.__name__ not in ["cli", "init"]:
loop.run_until_complete(Tortoise.close_connections())
return wrapper