From 701086e4b97dd940af4d3a2783e10b586ce33641 Mon Sep 17 00:00:00 2001 From: schneefux Date: Tue, 28 Feb 2017 18:16:15 +0100 Subject: properly request compile jobs --- api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'api.py') diff --git a/api.py b/api.py index 249c362..8ec7bdb 100644 --- a/api.py +++ b/api.py @@ -132,7 +132,7 @@ class Worker(object): RETURNING id """.format( "\", \"".join(keys), ", ".join(placeholders)) - await conn.execute(query, *data.values()) + objid = await conn.fetchval(query, *data.values()) if do_upsert_date: # upsert lmcd because it was an explicit request @@ -141,6 +141,8 @@ class Worker(object): WHERE player."lastMatchCreatedDate" < $1 """, lmcd) + return objid + async def _into(self, conn, data, table): """Insert a named tuple into a table. Return the object id.""" @@ -149,7 +151,7 @@ class Worker(object): placeholders = ["${}".format(i) for i, _ in enumerate(values, 1)] query = "INSERT INTO {} (\"{}\") VALUES ({}) ON CONFLICT DO NOTHING RETURNING id".format( table, "\", \"".join(keys), ", ".join(placeholders)) - await conn.execute(query, (*data)) + return await conn.fetchval(query, (*data)) async def _work(self): """Fetch a job and run it.""" -- cgit v1.3.1