diff options
| author | Kapil Viren Ahuja <kvahuja@users.noreply.github.com> | 2017-02-17 09:19:33 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-17 09:19:33 +0530 |
| commit | eaf6b29760f13040444707eecf9c342c67bd6ffb (patch) | |
| tree | 52d94256f033d09b2e4fd2712112c9758e81d460 /api.py | |
| parent | 07f17264500c388cb039eb33cdd89bc4f54d9505 (diff) | |
| parent | cfb59a7772aad708120c953fad30e88986f82441 (diff) | |
| download | shrinker-eaf6b29760f13040444707eecf9c342c67bd6ffb.tar.gz shrinker-eaf6b29760f13040444707eecf9c342c67bd6ffb.zip | |
Merge pull request #13 from vainglorygame/datachange
Fix participant conversion
Diffstat (limited to 'api.py')
| -rw-r--r-- | api.py | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -57,13 +57,8 @@ class Processor(object): stop_after -= 1 # TODO for debugging, don't process whole table async with srccon.transaction(): async with destcon.transaction(): - rec_o = "" - try: - async for rec in srccon.cursor(query): - rec_o = rec - await self.into(destcon, rec, table) - except: - logging.error("rec: %s", rec_o) + async for rec in srccon.cursor(query): + await self.into(destcon, rec, table) async def into(self, conn, data, table): """Insert a named tuple into a table.""" @@ -72,11 +67,7 @@ class Processor(object): placeholders = ["${}".format(i) for i, _ in enumerate(values, 1)] query = "INSERT INTO {} (\"{}\") VALUES ({})".format( table, "\", \"".join(keys), ", ".join(placeholders)) - try: - await conn.execute(query, (*data)) - except: - logging.error("Query: '%s'", query) - logging.error("Data: '%s'", data) + await conn.execute(query, (*data)) async def main(): |
