🎨 在关闭BOT前关闭 sqlmodel 在内存中的所有会话

This commit is contained in:
洛水居室 2022-09-26 16:52:17 +08:00
parent dd745d5440
commit 5cd072caa9
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -28,3 +28,6 @@ class MySQL(Service):
"""获取会话"""
async with self.Session() as session:
yield session
async def stop(self):
self.Session.close_all()