From d400c022c167fff643d286c6ce93f4a3a991d0c1 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Mon, 26 Mar 2018 15:35:31 +0000 Subject: [PATCH] Close db connection at end --- discordbot/titanembeds/database/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discordbot/titanembeds/database/__init__.py b/discordbot/titanembeds/database/__init__.py index 1a0c314..eb3af33 100644 --- a/discordbot/titanembeds/database/__init__.py +++ b/discordbot/titanembeds/database/__init__.py @@ -34,10 +34,11 @@ class DatabaseInterface(object): session = Session() try: yield session + session.commit() except: session.rollback() finally: - session.commit() + session.close() async def push_message(self, message): if message.guild: