summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-03-08 18:21:41 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-03-08 18:21:41 +0100
commit878ee48a5a60e1f197d38912eb3fa3732fc08a64 (patch)
treef53babdbb6bb5a85d92f23f9479ac566949719f8
parent7832197c4a4259883d728ad2259129bcc5af0ded (diff)
downloadcompiler-878ee48a5a60e1f197d38912eb3fa3732fc08a64.tar.gz
compiler-878ee48a5a60e1f197d38912eb3fa3732fc08a64.zip
do not use pooling, not needed
-rw-r--r--api.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/api.py b/api.py
index c88a39a..f75c9a4 100644
--- a/api.py
+++ b/api.py
@@ -28,7 +28,7 @@ db_config = {
class Compiler(joblib.worker.Worker):
def __init__(self):
- self._pool = None
+ self._con = None
self._queries = {}
super().__init__(jobtype="compile")
@@ -36,7 +36,7 @@ class Compiler(joblib.worker.Worker):
"""Connect to database."""
logging.warning("connecting to database")
await super().connect(**queuedb)
- self._pool = await asyncpg.create_pool(**dbconf)
+ self._con = await asyncpg.connect(**dbconf)
async def setup(self):
"""Initialize the database."""
@@ -55,7 +55,6 @@ class Compiler(joblib.worker.Worker):
async def _windup(self):
- self._con = await self._pool.acquire()
self._tr = self._con.transaction()
await self._tr.start()
@@ -64,7 +63,6 @@ class Compiler(joblib.worker.Worker):
await self._tr.rollback()
else:
await self._tr.commit()
- await self._pool.release(self._con)
async def _execute_job(self, jobid, payload, priority):
"""Finish a job."""