summaryrefslogtreecommitdiff
path: root/api.py
diff options
context:
space:
mode:
Diffstat (limited to 'api.py')
-rw-r--r--api.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/api.py b/api.py
index 873e8be..e7e690d 100644
--- a/api.py
+++ b/api.py
@@ -72,11 +72,13 @@ class Compiler(joblib.worker.Worker):
return
logging.debug("%s: compiling '%s' from '%s'",
jobid, object_id, table)
- tasks = []
for query in self._queries[table]:
- tasks.append(asyncio.ensure_future(
- self._con.execute(query, object_id)))
- await asyncio.gather(*tasks)
+ try:
+ await self._con.execute(query, object_id)
+ except asyncpg.exceptions.DeadlockDetectedError:
+ logging.error("%s: deadlocked!", jobid)
+ raise joblib.worker.JobFailed("deadlock",
+ True) # critical
async def startup():