From f5a815e2f80217ca9420989fdbc176158ff11e21 Mon Sep 17 00:00:00 2001 From: schneefux Date: Mon, 27 Feb 2017 15:22:58 +0100 Subject: fix raw processing to one instead of multiple records --- api.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'api.py') diff --git a/api.py b/api.py index bfce108..1163584 100644 --- a/api.py +++ b/api.py @@ -76,17 +76,18 @@ class Worker(object): # fetch from raw, converted to format for web table if table == "player": # upsert under special conditions - data = await srccon.fetchrow( + datas = await srccon.fetch( query, object_id, explicit_player) - if data["name"] == explicit_player: + for data in datas: await self._playerinto(destcon, data, - table, - True) + table, + data["name"] == explicit_player) else: - data = await srccon.fetchrow( + datas = await srccon.fetch( query, object_id) - # insert processed result into web table - await self._into(destcon, data, table) + for data in datas: + # insert processed result into web table + await self._into(destcon, data, table) data = await srccon.fetchrow( "DELETE FROM match WHERE id=$1", object_id) -- cgit v1.3.1