summaryrefslogtreecommitdiff
path: root/joblib.py
diff options
context:
space:
mode:
Diffstat (limited to 'joblib.py')
-rw-r--r--joblib.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/joblib.py b/joblib.py
index 0c529ea..5c61f98 100644
--- a/joblib.py
+++ b/joblib.py
@@ -123,16 +123,17 @@ class JobQueue(object):
async def finish(self, jobid):
"""Mark jobs as completed."""
async with self._pool.acquire() as con:
+ update = await con.prepare("""
+ UPDATE jobs
+ SET status='finished'
+ WHERE id=$1
+ """)
if not isinstance(jobid, list):
jobids = [jobid]
else:
jobids = jobid
for jid in jobids:
- await con.execute("""
- UPDATE jobs
- SET status='finished'
- WHERE id=$1
- """, jid)
+ await update.fetch(jid)
async def fail(self, jobid, reason):
"""Mark a job as failed."""