From 8c702a854d9eb4dc1bdc6f439e108c2894c5e7a3 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Mon, 21 May 2018 19:13:40 -0800 Subject: [PATCH] Switch to Asyncpg for db con --- shared_libs/database.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared_libs/database.py b/shared_libs/database.py index 52c6395..0b4660c 100644 --- a/shared_libs/database.py +++ b/shared_libs/database.py @@ -7,7 +7,8 @@ class DatabaseConnection: if username == '' or password == '' or database == '': raise RuntimeError('Username or Password are blank') self.kwargs = {'host': host, 'port': port, 'database': database, 'username': username, 'password': password} - self._conn = asyncio.get_event_loop().run_until_complete(self.acquire()) + self._conn = None + asyncio.get_event_loop().run_until_complete(self.acquire()) self.fetchval = self._conn.fetchval self.execute = self._conn.execute self.fetchall = self._conn.fetchall