Close db connection at end

This commit is contained in:
Jeremy Zhang 2018-03-26 15:35:31 +00:00
parent 5fa1e43e2a
commit d400c022c1

View File

@ -34,10 +34,11 @@ class DatabaseInterface(object):
session = Session() session = Session()
try: try:
yield session yield session
session.commit()
except: except:
session.rollback() session.rollback()
finally: finally:
session.commit() session.close()
async def push_message(self, message): async def push_message(self, message):
if message.guild: if message.guild: