Skip to content

Commit a729a30

Browse files
committed
Implement proper Prisma client disposal.
1 parent 40377e2 commit a729a30

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

nameless/custom/crud.py

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ class NamelessCRUD:
1414
async def init() -> None:
1515
await raw_db.connect()
1616

17+
@staticmethod
18+
async def dispose() -> None:
19+
await raw_db.disconnect()
20+
1721
@staticmethod
1822
async def get_or_create_guild_entry(
1923
guild: discord.Guild, *, include_cross_chat: bool = False

nameless/nameless.py

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def start_bot(self, *, is_debug: bool = False) -> None:
6969
@override
7070
async def close(self) -> None:
7171
logging.warning("Shutting down...")
72+
await NamelessCRUD.dispose()
7273
await super().close()
7374
exit(0)
7475

0 commit comments

Comments
 (0)