Merge pull request #121 from AulonSal/close-tortoise-connections
Close Tortoise connections properly
This commit is contained in:
commit
49897dc4fd
@ -2,6 +2,10 @@
|
||||
|
||||
## 0.5
|
||||
|
||||
### 0.5.1
|
||||
|
||||
- Fix tortoise connections not being closed properly. (#120)
|
||||
|
||||
### 0.5.0
|
||||
|
||||
- Refactor core code, now has no limitation for everything.
|
||||
|
@ -1 +1 @@
|
||||
__version__ = "0.5.0"
|
||||
__version__ = "0.5.1"
|
||||
|
@ -35,7 +35,13 @@ def coro(f):
|
||||
@wraps(f)
|
||||
def wrapper(*args, **kwargs):
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(f(*args, **kwargs))
|
||||
|
||||
# Close db connections at the end of all all but the cli group function
|
||||
try:
|
||||
loop.run_until_complete(f(*args, **kwargs))
|
||||
finally:
|
||||
if f.__name__ != "cli":
|
||||
loop.run_until_complete(Tortoise.close_connections())
|
||||
|
||||
return wrapper
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "aerich"
|
||||
version = "0.5.0"
|
||||
version = "0.5.1"
|
||||
description = "A database migrations tool for Tortoise ORM."
|
||||
authors = ["long2ice <long2ice@gmail.com>"]
|
||||
license = "Apache-2.0"
|
||||
|
Loading…
x
Reference in New Issue
Block a user