summaryrefslogtreecommitdiff
path: root/api.py
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-02-28 18:16:15 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-02-28 18:18:37 +0100
commit701086e4b97dd940af4d3a2783e10b586ce33641 (patch)
tree618c5e072e0680dbf790426deff2f856b7363385 /api.py
parent5b8f4896badcbc11513466f0b5e457a8f1551745 (diff)
downloadshrinker-701086e4b97dd940af4d3a2783e10b586ce33641.tar.gz
shrinker-701086e4b97dd940af4d3a2783e10b586ce33641.zip
properly request compile jobs
Diffstat (limited to 'api.py')
-rw-r--r--api.py6
1 files changed, 4 insertions, 2 deletions
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."""