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
|
||||||
|
|
||||||
|
### 0.5.1
|
||||||
|
|
||||||
|
- Fix tortoise connections not being closed properly. (#120)
|
||||||
|
|
||||||
### 0.5.0
|
### 0.5.0
|
||||||
|
|
||||||
- Refactor core code, now has no limitation for everything.
|
- 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)
|
@wraps(f)
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
loop = asyncio.get_event_loop()
|
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
|
return wrapper
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "aerich"
|
name = "aerich"
|
||||||
version = "0.5.0"
|
version = "0.5.1"
|
||||||
description = "A database migrations tool for Tortoise ORM."
|
description = "A database migrations tool for Tortoise ORM."
|
||||||
authors = ["long2ice <long2ice@gmail.com>"]
|
authors = ["long2ice <long2ice@gmail.com>"]
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user